Pen-shaped handwriting input apparatus using accelerometers and gyroscopes and an associated operational device for determining pen movement

ABSTRACT

A small-sized pen-shaped input apparatus precisely detects handwriting input. The apparatus compensates for the effects of the inclination of the pen-shaped input apparatus. An initial inclination angle calculating section calculates the initial value of the inclination angle of a pen shaft in a gravity coordinate system. The inclination angle variation calculating section calculates a variation value of the inclination angle of the pen shaft. A handwriting inclination angle calculating section calculates the inclination angle of the pen shaft when writing. A coordinates conversion calculating section converts the coordinate system of the acceleration from the pen shaft coordinate system to the gravity coordinate system. A movement amount calculating section calculates the movement direction and the movement distance of the pen&#39;s tip end. Finally, a handwriting detecting section detects a state of handwriting or non-handwriting.

This application is a divisional of Ser. No. 08/803,395, filed Feb. 20,1997.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a pen-shaped input apparatus forinputting figures, symbols, characters and the like into a dataprocessing device, such as a computer.

2. Description of the Related Art

Conventionally, a keyboard, mouse, digitizer, light pen, and tablet,etc. have been used as an input apparatus employed in a computerapparatus or the like. Such computer apparatus needs to be small-sized,and there is a growing need for a portable terminal instrument as thenumber of users increases year by year. Consequently, a small-size inputapparatus is also required.

There is a limitation on making the keyboard small-sized from theviewpoint of the human interface, and a keyboard is not a practicalinput apparatus for a portable terminal instrument. Furthermore,although the mouse can be made in a small-size and used as a pointingdevice, it is not suitable for inputting figures and characters, etc.into a data processor.

For this reason, on many occasions, a pen-shaped input apparatusemploying a tablet and pen have been adopted as the input apparatus fora portable terminal instrument. However, it is difficult to reduce thesize of the tablet.

To overcome the problem of tablet size, tabletless input apparatuseshave been developed such as, for instance, a pen-shaped computer inputapparatus as disclosed in Japanese Laid-open Patent Publication No.6-67799/1994, a data input apparatus as disclosed in Japanese Laid-openPatent Publication No. 7-84716/1995, a handwriting input apparatus asdisclosed in Japanese Laid-open Patent Publication No. 7-200127/1995,and a pencil-shaped input apparatus as disclosed in Japanese Laid-openPatent Publication No. 6-230886/1994.

The pen-shaped computer input apparatus disclosed in Japanese Laid-openPatent Publication No. 6-67799/1994 senses the movement direction andthe movement amount of the input apparatus by use of an accelerationsensor and then compensates for an influence exerted on the movementdirection and the movement amount sensed by the acceleration sensor bythe action of the pen-shaped computer input apparatus' rotation by useof a piezoelectric vibration gyroscope.

Furthermore, the data input apparatus disclosed in Japanese Laid-openPatent Publication No. 7-84716/1995 senses the movement direction andthe movement amount of the apparatus on the basis of signals showing thepolarity and the amplitude respectively transmitted from vibrationgyroscopes perpendicularly disposed to each other.

Furthermore, the handwriting input apparatus disclosed in JapaneseLaid-open Patent Publication No. 7-200127/1995 obtains a movementdirection and a movement distance (amount) on the basis of the signalsrespectively transmitted from two acceleration sensors.

Furthermore, the pencil-shaped input apparatus disclosed in JapaneseLaid-open Patent Publication No. 6-230886/1994 disposes a couple ofacceleration sensors on different positions of the pen shaft, andobtains a movement direction and a movement distance of the pen's tipend. In this apparatus, the influence due to the mounting position ofthe acceleration sensors is compensated on the basis of the output fromthe couple of acceleration sensors.

And further, a position sensor disclosed in the published specificationof Japanese Laid-open Patent Publication No. 7-294240/1995, which doesnot directly relate to the pen-shaped input apparatus is used, forinstance, in a game machine for sensing the moving speed, position andattitude of the head portion of human body, and the position sensorcomprises acceleration sensors for respectively sensing theaccelerations in the X-axis direction, the Y-axis direction, and theZ-axis direction and gyroscopes for respectively sensing the angularvelocities around the X axis, the Y axis, and the Z axis. This apparatusperforms a strap-down type operational calculation on the basis of theaccelerations and the angular velocities detected by those sensors anddetects the moving speed, position, attitude, and direction of the headportion of the human body.

SUMMARY OF THE INVENTION

Since the pen-shaped computer input apparatus disclosed in JapaneseLaid-open Patent Publication No. 6-67799/1994 compensates only foreffects due to the rotation of the apparatus, it can not compensate foreffects caused by dynamic inclination. At the time of performing anordinary handwriting operation, the apparatus may be accompanied with adynamic inclination and therefore the result of detection is not preciseon some occasions.

Furthermore, since the data input apparatus disclosed in JapaneseLaid-open Patent Publication No. 7-84716/1995 detects the rotationalmovement of the wrist and inputs the movement direction and the movementdistance in accordance with the detected result, the data inputapparatus is not suitable for inputting figures, and the like.

Furthermore, the handwriting input apparatus disclosed in JapaneseLaid-open Patent Publication No. 7-200127/1995 does not comprise anycompensation medium for compensating for the inclination and therotation of the apparatus, and therefore the detection result is notprecise on some occasions.

Furthermore, since the pencil-shaped input apparatus disclosed inJapanese Laid-open Patent Publication No. 6-230886/1994 does not takeinto consideration the fact that the component for the rotational angleof the apparatus is contained in the acceleration detected by theacceleration sensor, the detection error of the movement distancebecomes large on some occasions.

Moreover, since the position sensor disclosed in Japanese Laid-openPatent Publication No. 7-294240/1995 specially detects the movingvelocity, position, attitude, and direction of the head portion,although the sensor performs a complicated operational calculation, themovement direction and the movement distance on the handwriting surfacehas to be detected precisely using a simple operational calculatingprocess because of the requirement of making the apparatus small-sized.

Furthermore, in the case of employing the position sensor as disclosedin Japanese Laid-open Patent Publication No. 7-294240/1995 the threeacceleration sensors cannot be arranged at the pen's tip end, andtherefore an error occurs due to the difference between the mountingpositions of the pen's tip end and the acceleration sensor. Therefore,the handwriting input cannot be detected precisely on some occasions.

The present invention has been made in consideration of the foregoingproblems.

Thus, one object of the present invention to overcome the problemsmentioned above.

Another object of the present invention to eliminate the defects in theexisting devices mentioned above.

Still another object of the present invention is to provide asmall-sized pen-shaped input apparatus.

BRIEF DESCRIPTION OF THE DRAWINGS

A more complete appreciation of the present invention and many of theattendant advantages thereof will be readily obtained as the samebecomes better understood by reference to the following detaileddescription when considered in connection with the accompanyingdrawings, wherein:

FIG. 1 is a structural view showing a first embodiment according to thepresent invention;

FIG. 2 is a block diagram showing the circuit of an operationalcalculating section of the first embodiment;

FIG. 3 is a flow chart showing the operation of a pen-shaped inputapparatus of the first embodiment;

FIG. 4 is a side view of the pen-shaped input apparatus in which thehandwriting surface is not horizontal;

FIG. 5 is a block diagram showing the circuit of the operationalcalculating section which includes an acceleration compensating section;

FIG. 6 is an explanatory diagram showing the variation of an inclinationangle of the pen-shaped input apparatus;

FIG. 7 is an explanatory diagram showing the coordinates difference incase that the coordinate system of the pen shaft does not coincide withthe coordinate system of the handwriting surface;

FIG. 8 is a perspective view of another pen-shaped input apparatus whichis a modification of the first embodiment according to the presentinvention;

FIG. 9 is a block diagram of an operational calculating section of thepen-shaped input apparatus of the modification;

FIG. 10 is a structural view showing a second embodiment according tothe present invention;

FIG. 11 is a block diagram showing the circuit of an operationalcalculating section of the second embodiment;

FIG. 12 is a diagram showing a waveform of an acceleration signal;

FIG. 13 is a side view of a pen-shaped input apparatus of the secondembodiment showing one point on the pen-shaped input apparatus;

FIG. 14 is a flow chart showing the operation of the pen-shaped inputapparatus;

FIG. 15 is perspective view of a handwriting surface, wherein FIG. 15ashows three-dimensional data of the handwriting orbit and FIG. 15b showsan error thereof;

FIG. 16 is an explanatory diagram for explaining an f₁₃ -component;

FIG. 17 is an explanatory diagram for explaining an f₂₃ -component;

FIG. 18 is an explanatory diagram for explaining an f₃₃ -component;

FIG. 19 is a perspective view of a handwriting surface where theshortest distance between the pen-shaped input apparatus and the surfaceto be handwritten is made in the direction of Zg axis;

FIG. 20 is a structural view showing a third embodiment according to thepresent invention;

FIG. 21 is a block diagram showing the circuit of an operationalcalculating section of the third embodiment;

FIG. 22 is a block diagram showing the structure of the handwritingdetecting section;

FIG. 23 is a flow chart showing the operation of the pen-shaped inputapparatus;

FIG. 24 is a waveform diagram showing the acceleration signal in thecase of drawing a circle mark;

FIG. 25 is a waveform diagram of the acceleration signal in the staticstate;

FIG. 26 is a structural view showing an operational calculating sectionfor calculating the initial rotational angle by use of the averagevalue;

FIG. 27 is a structural view showing an initial rotational anglecalculating section for calculating the initial rotational angle by useof the average value;

FIG. 28 is a flow chart showing the operation of calculating the initialrotational angle;

FIG. 29 is a structural view showing an operational calculating sectionincluding an alarming section;

FIG. 30 is a block diagram showing the construction of a variationamount comparing section;

FIG. 31 is a waveform diagram representing the relationship between thevariation amount of the acceleration and a threshold value;

FIG. 32 is a structural view showing the pen-shaped input apparatusincluding a pressure sensor;

FIG. 33 is graph showing the variation of the acceleration, wherein FIG.33a is a graph showing the variation thereof in a wide range and FIG.33b is another graph showing the variation thereof partly enlarged inthe area encircled by the dotted line in FIG. 33a;

FIG. 34 is a diagram generally illustrating the Eulerian angles; and

FIG. 35 is a diagram explaining the coordinates of the pen shaft.

DETAILED DESCRIPTION OF THE INVENTION

A. Explanation of Coordinate Systems

Prior to the explanation of the first through third embodiments, theconcept of the gravity coordinate system and the pen shaft coordinatesystem is described here, particularly with respect to the frame ofreference transformation, and the definition of "Eulerian" angles as tothe pen motion, shown in FIG. 34.

The definition of two frames of reference are a laboratory frame (Xg,Yg, Zg) and a pen frame (Xs, Ys, Zs). The former relates to the gravitycoordinate system while the latter relates to the pen shaft coordinatesystem. FIG. 34 shows the steps of converting the gravity coordinatesystem for the pen-shaped inputting system to the pen shaft coordinatesystem.

The definition of the Eulerian angles (ψ, θ, φ) can be respectivelyexpressed by the following three matrix equations (1), (2), and (3):

ψ: rotating (Xg, Yg, Zg) around Zg, define the angle until Xg axis goesacross the Zg-Xs flat. Then (X₁, Y₁, Z₁) is formed. ##EQU1## θ: rotatingaround the Y₁ newly formed axis, define the angle until the X₁ axis isin accord with the Xs axis. Then (X₂, Y₂, Z₂) is formed. ##EQU2## φ:rotating around the X₂ axis, define the angle Xs and Zs according toeach other. Then (Xs, Ys, Zs), that is the pen frame, is formed.##EQU3##

FIG. 35 shows the coordinates of the pen shaft of the pen-shaped inputapparatus in the case of putting the pen shaft vertically and on a fixedpoint and in the case of putting the pen shaft on an optional point asorigin in a state of being inclined when the handwriting operation isperformed.

The details of the relationship between the respective coordinates andthe movement of the pen shaft are described hereinafter, referring tothe first, second, and third embodiments according to the presentinvention.

B. Detailed Description of the First Embodiment and its Modification

The pen-shaped input apparatus of the first embodiment according to thepresent invention comprises three acceleration sensors, three gyroscopesand an operational calculating section. The three acceleration sensorsrespectively detect the accelerations in the X-axis, Y-axis, and Z-axisdirections of the pen-shaft coordinate system around the Z axis of thepen shaft. The three gyroscopes respectively detect the angular velocityaround the X axis, Y axis, and Z axis. The operational calculatingsection comprises an initial inclination angle calculating section, aninclination angle variation calculating section, a handwritinginclination angle calculating section, a coordinates conversioncalculating section, and a movement amount calculating section.

The initial inclination angle calculating section calculates the initialvalue of the pen shaft inclination angle in the gravity coordinatesystem around a Z axis which extends in the gravity accelerationdirection (vertically) on the basis of the accelerations detected by thethree acceleration sensors when the pen shaped input apparatus is in astate of non-handwriting.

The inclination angle variation calculating section calculates thevariation of the inclination angle of the pen shaft in the gravitycoordinate system on the basis of the angular velocities detected by thethree gyroscopes when the pen shaped input apparatus is in a state ofhandwriting.

The handwriting inclination angle calculating section calculates theinclination angle of the handwriting pen shaft in the gravity coordinatesystem on the basis of the initial value of the inclination anglecalculated by the initial inclination angle calculating section and thevariation of the inclination angle calculated by the inclination anglevariation calculating section.

The coordinates conversion calculating section converts the accelerationin the pen shaft coordinate system detected by the acceleration sensorto the acceleration in the gravity coordinate system on the basis of theinclination angle of the handwriting pen shaft in the gravity coordinatesystem calculated by the handwriting inclination angle calculatingsection.

The movement amount calculating section calculates the movementdirection and the movement distance of the pen's tip end on the basis ofthe acceleration converted by the coordinates conversion calculatingsection and thereby the movement direction and the movement distance ofthe tip end of the small-sized pen moving on the handwriting surface.

Furthermore, the movement distance of the pen's tip end calculated bythe movement amount calculating section on the basis of the inclinationto the gravity coordinate system on the handwriting surface iscompensated to the movement distance on the handwriting surface, andthereby even when the handwriting surface is not horizontal, themovement direction and the movement distance of the pen's tip end can bedetected precisely.

Furthermore, there are provided by-pass filters transmitting thehigh-frequency component of the signals of the three accelerationsensors and the three gyroscopes at frequencies above the neighborhoodof 10 Hz. The actual frequencies of interest are frequencies caused byfriction between the writing pen and writing surface which occur about100 Hz. Other frequencies, caused by the movement of the writingimplement which occur at or about 5 Hz are excluded by the 10 Hz cutoff.The beginning of handwriting is judged on the basis of the presence ofthe signal containing the high-frequency component at the beginning ofany one of the signals from the three acceleration sensors and the threegyroscopes passing through the high-pass filters. In such manner, thestart of the handwriting can be detected precisely. Likewise, when thehigh frequency component is absent from all the signals from theacceleration sensors and gyroscopes, for a threshold period of time,this indicates the ending of a handwriting operation.

Furthermore, there is provided an acceleration compensation section forcalculating the value of the acceleration variation due to theinclination angle variation on the basis of the variation of theinclination angle in the gravity coordinate system of the handwritingpen shaft detected by the inclination angle variation and the positionof mounting the acceleration sensor, and compensating the accelerationdetected by the acceleration sensor, and the coordinates calculatingsection converts the acceleration compensated by the accelerationcompensating section to the acceleration in the gravity coordinatesystem. In such manner, the influence due to the variation of theinclination angle during the time period of handwriting is eliminated.

Furthermore, the acceleration compensating section calculates acentrifugal force due to the variation of the inclination angle appliedto the acceleration sensor on the basis of the speed variation of theinclination angle in the gravity coordinate system of the handwritingpen shaft detected by the inclination angle variation calculatingsection and the position of mounting the acceleration sensor. And then,the value of the acceleration variation due to the inclination anglevariation is compensated on the basis of the above calculatedcentrifugal force, the acceleration detected by the acceleration sensoris compensated thereby, and the component of the centrifugal force dueto the inclination angle variation of the acceleration detected by theacceleration sensor is compensated, and thereby the component of thecentrifugal force accompanying the inclination angle variation of theacceleration detected by the acceleration sensor is also compensated.

Furthermore, the difference between the coordinates of the location ofthe acceleration sensors relative to the handwriting surface and thecoordinates of the pen's tip end is compensated on the basis of theinclination angle in the gravity coordinate system of the handwritingdetected by the handwriting inclination angle calculating section. Insuch manner, the entire input figure can be prevented from beingdeviated (shifted).

And further, the pen-shaped input apparatus comprises an apparatus mainbody and an inclination angle detecting apparatus for detecting theinclination angle of the pen shaft in the gravity coordinate system. Theapparatus main body comprises three acceleration sensors and anoperational calculating section. The three acceleration sensors detect,respectively, the accelerations in the X-axis direction, the Y-axisdirection, and the Z-axis direction of the pen shaft coordinates systemin which the pen shaft is the Z axis.

The operational calculating section comprises a coordinates conversioncalculating section and a movement amount calculating section. Thecoordinates conversion calculating section converts the accelerationobtained in accordance with the pen shaft coordinates system to anacceleration in the gravity coordinate system on the basis of theinclination angle of the pen shaft in the gravity coordinate system asmeasured by the inclination angle detecting apparatus. The movementamount calculating section calculates the movement direction and themovement distance of the pen's tip end on the basis of the accelerationas converted by the coordinates conversion calculating section. In suchmanner, the construction of the apparatus main body can be simplifiedand the accuracy of detecting the inclination angle can be raised at thesame time.

Moreover, the handwriting state may be judged in the pen-shaped inputapparatus by use of an enable switch, etc. instead of on the basis ofthe presence of the high frequency components of the signals from theacceleration sensors and the gyroscopes. When the latter technique isused, the pen-shaped input apparatus uses a by-pass filter transmittingthe high-frequency component of the signals from the accelerationsensors and the gyroscopes above the neighborhood of a frequency near 10Hz. As noted, the actual frequencies of interest are about 100 Hz. Sincethe high-frequency component of the signals from the accelerationsensors, etc. is generated by the action of the friction between thepen's tip end and the handwriting surface and the frequency thereof isabove the neighborhood of 10 Hz, the pen-shaped input apparatus judges,as "handwriting", the time period when the above-mentionedhigh-frequency component is detected in any one of the signals from thethree acceleration sensors and the three gyroscopes. In such manner,operational errors can be prevented and the start of the handwriting canbe detected precisely. The end of the handwriting can be detected whenthe high frequency component is no longer present in any of the signalsfrom the acceleration sensors and gyroscopes for a threshold period oftime.

And further, the pen-shaped input apparatus may be divided into a mainbody and the inclination angle detecting apparatus for detecting theinclination angle between the handwriting surface and the apparatus mainbody disposed just above the handwriting surface.

FIG. 1 is a structural view showing a pen-shaped input apparatus of afirst embodiment according to the present invention. As shown in FIG. 1,the pen-shaped input apparatus 1 comprises acceleration sensors 2a, 2b,and 2c, gyroscopes 3a, 3b, and 3c, an operational calculating section 4,a memorizing section 5, and a power supply section 6.

The acceleration sensors 2a, 2b, and 2c are respectively disposed in thedirections of Xs axis, Ys axis, and Zs axis, all of which areintersected perpendicularly to each other, wherein the pen shaftcoincides with the Zs axis, and the sensors 2a, 2b, and 2c detect,respectively, the accelerations in the Xs-axis, Ys-axis, and Zs-axisdirections at the pen's tip end 8. A piezo-electric type sensor or anelectrostatic capacitance type sensor may be used as the accelerationsensors 2a, 2b, and 2c as well as a piezo-electric resistance typesensor. The gyroscopes 3a, 3b, and 3c respectively detect the angularvelocities around the Xs axis, the Ys axis, and the Zs axis.

In the following description, the coordinate system of the pen shaft 7coinciding with the Zs axis is called the pen shaft coordinate system,and the two axes both intersected perpendicularly to the pen shaft 7 andto each other are respectively called the Xs axis and the Ys axis.

And further, the coordinate system having a Zg axis extending in thegravity acceleration direction (vertically) is called the gravitycoordinates system and the two axes intersected perpendicularly to theZg axis and to each other are respectively called the Xg axis and the Ygaxis. Furthermore, the angles formed between the Xs axis and the Ysaxis, between the Zs axis and the Xg axis, and between the Yg axis andZg axis are respectively specified as θ, φ, and ψ.

As shown in FIG. 2, the operational calculating section 4 comprises A/Dconverters 41a-41f, low-pass filters 42a-42f, a high-pass filter 43, aninitial inclination angle calculating section 44, an inclination anglevariation calculating section 45, a handwriting inclination calculatingsection 46, a coordinates conversion calculating section 47, and amovement amount calculating section 48.

The A/D converters 41a-41f respectively convert the analog signals fromthe acceleration sensors 2a, 2b, and 2c, and the gyroscopes 3a, 3b, and3c to digital signals. The low-pass filters 42a-42f intercept thehigh-frequency component of the signals from the acceleration sensors2a, 2b, and 2c and the gyroscopes 3a, 3b, and 3c caused by the action ofthe friction force between the pen's tip end 8 and the handwritingsurface. The high-pass filter 43 extracts, for instance, thehigh-frequency component, above the neighborhood of 10 Hz, of thesignals from the acceleration sensors 2a, 2b, and 2c and the gyroscopes3a, 3b, and 3c caused by the action of the friction force. This highfrequency component, when present, indicates the beginning of a writingcondition. Before the high frequency component occurs, its absenceindicates that a handwriting operation has not yet begun. In addition,once the high frequency component appears, its later absence from theacceleration sensor and gyroscope signals for a threshold periodindicates that a writing condition has ended.

The initial inclination angle calculating section 44 calculates theinitial values θ₀, φ₀, and ψ₀ of the inclination angles in the gravitycoordinate system of the pen shaft 8 on the basis of the acceleration inthe pen shaft coordinate system detected by the three accelerationsensors 2a, 2b, and 2c in a state of non-handwriting.

The inclination angle variation calculating section 45 calculates thevariations Δθ, Δφ, and Δψ of the inclination angle in the gravitycoordinate system of the pen shaft 8 on the basis of the angularvelocity detected by the three gyroscopes 3a, 3b, and 3c in a state ofhandwriting. The handwriting inclination angle calculating section 46obtains the inclination angles θ, φ, and ψ in the gravity coordinatesystem of the handwriting pen shaft 8 on the basis of the initial valuesθ₀, φ₀, and ψ₀ of the inclination angle in the gravity coordinate systemof the pen shaft 8 calculated by the initial inclination anglecalculating section 44, and the variations Δθ, Δφ, and Δψ of theinclination angle in the gravity coordinate system of the pen shaft 8calculated by the inclination angle variation calculating section 45.The coordinates conversion calculating section 47 converts theacceleration in the pen shaft coordinate system detected by theacceleration sensors 2a, 2b, and 2c to the acceleration in the gravitycoordinate system on the basis of the inclination angles θ, φ, and ψ inthe gravity coordinate of the handwriting pen shaft 8 detected by thehandwriting inclination angle calculated by the handwriting inclinationangle calculating section 46.

The movement amount calculating section 48 calculates the movementdirection and the movement distance of the pen's tip end 8 on the basisof the acceleration in the gravity coordinate system thus converted bythe coordinates conversion calculating section 47 and the section 48stores the calculated values in the storage section 5.

The operation of the pen-shaped input apparatus 1 constructed asmentioned above is described referring to the flow chart of FIG. 3.

The acceleration sensors 2a, 2b, and 2c respectively detect theaccelerations in the Xs direction, the Ys direction, and the Zsdirection. The high-pass filter 43 extracts the high-frequency componentof the signals from the acceleration sensors 2a, 2b, and 2c and thegyroscopes 3a, 3b, and 3c inputted through the A/D converters 41a-41f,all of which exceed the neighborhood of 10 Hz.

In such manner, the high-frequency signals caused by the action of thefriction force between the pen's tip end 8 and the handwriting surfaceare detected respectively, and thereby a judgment can be made on whetherthe input apparatus is in the state of "handwriting" or"not-handwriting". Therefore, it is possible to detect easily andprecisely the state of handwriting or not-handwriting.

The initial inclination angle calculating section 44 respectively inputsthe signals from the acceleration sensor 2a for the Xs axis, theacceleration sensor 2b for the Ys axis, and the acceleration sensor 2cfor the Zs axis when it does not receive the signal showing the state of"handwriting" from the by-pass filter, and calculates the initial valuesθ₀, φ₀, and ψ₀ of the inclination angles in the gravity coordinatesystem of the pen shaft 8 (Step S1).

Hereupon, the calculation of the afore-mentioned inclination angle isdescribed hereinafter. The conversion from the gravity coordinatessystem to the pen shaft coordinates system can be performed inaccordance with the following equation: ##EQU4##

The equation (equation 4) can be changed from the conversion formula ofthe pen shaft coordinate system to that of the gravity coordinatesystem, and thereby the following equation (equation 5) can be obtained.##EQU5##

The above equation (equation 5) is approximated with a first-order(linear) approximation formula and converted to the acceleration vectorequation, and thereby the following two equations (equations 6a,6b) canbe obtained. Hereupon, it is assumed that the acceleration vectorsdetected by the acceleration sensors 2a, 2b, and 2c in the pen shaftcoordinate system are, respectively, Axs, Ays, and Azs, while theacceleration vectors detected by the acceleration sensors 2a, 2b, and 2cin the gravity coordinate system are Axg, Ayg, and Azg. ##EQU6##

The acceleration vectors Axs, Ays, and Azs and the inclination angles θ,φ, and ψ are respectively substituted for the above-mentioned tentativeapproximation formula, and thereby acceleration vectors Axg, Ayg, andAzg can be obtained on the handwriting surface.

On the other hand, the acceleration in the static state is expressed bythe following equation (equation 7). ##EQU7##

The equation 7 is substituted for the equations 6a, 6b, and thereby thefollowing equation (equation 8) can be obtained. ##EQU8##

The inclination angles θ₀, φ₀, and ψ₀ in the gravity coordinates systemof the pen shaft 8 put in the static state can be obtained (calculated)from the above equation (equation 8).

Hereupon, since three equations can be established for the inclinationangles θ₀ and φ₀ in the static state, the gravity acceleration "g" canbe treated as an absolute value, and absolute values of the inclinationangles θ₀ and φ₀ in the static state can be calculated without definingthe value of "g". Furthermore, it may be allowed also to calculate thevalue of the gravity acceleration "g", judge whether the operationalcalculation is good or bad in accordance with the variation of the valueof the gravity acceleration "g" thus calculated, and issue an alarmsignal, for instance, in case that the calculated value varies largely.

When the inclination angle calculating section 45 receives the signalshowing "handwriting" from the by-pass filter 43 (step S2), thevariations Δθ, Δφ, and Δψ of the inclination angles in the gravitycoordinates system of the pen shaft 8 are calculated on the basis of theangular velocities detected by the three gyroscopes 3a, 3b, and 3c (StepS3).

Assuming that the rotational angular velocities of the (angular) axesXs, Ys, and Zs in the pen coordinates are P, Q, and R, the relationshipbetween the rotational angular velocities P, Q, and R and theinclination angle variations Δψ, Δθ, and Δφ can be obtained (calculated)in accordance with the following equations (equations 9).

    Δφ=P+Q sin φ tan θ+R cos φ tan θ

    Δθ=Q cos θ-R sin θ

    Δψ=Q sin φ cos θ+R cos φ secθ(9

As mentioned above, the handwriting inclination angle calculatingsection 46 obtains (calculates) the inclination angles θ, φ, and ψ ofthe handwriting pen shaft on the basis of the initial values θ₀, φ₀, andψ₀ of the inclinations of the pen shaft 8 calculated by the initialinclination angle calculating section 44 and the inclination anglevariations Δθ, Δφ, and Δψ of the pen shaft 8 calculated by theinclination angle variation calculating section 45 (Step S4).

The coordinates conversion calculating section 4 converts theaccelerations Axs, Ays, and Azs of the pen shaft calculated by theacceleration sensors 2a, 2b, and 2c to the accelerations Axg, Ayg, andAzg in the gravity coordinate system on the basis of the inclinationangle during handwriting detected by the handwriting inclination anglecalculating section 46 (Step S5).

Hereupon, the conversion formula which has been already explained isemployed in order to convert the accelerations Axs, Ays, and Azs in thepen shaft coordinates system to the accelerations Axg, Ayg, and Azg inthe gravity coordinate system.

The movement amount calculating section 48 calculates the movementdirection and the movement distance of the pen's tip end 8 on the basisof the acceleration of the pen's tip end 8 converted by the coordinatesconversion calculating section 47 (Step S6), and stores the values thuscalculated in the storage section 5 (Step S7).

The pen-shaped input apparatus 1 repeats the above-mentioned operations(Steps S3-S7) during the time period of outputting the signal showingthat the high-pass filter 43 is put in the operation of the handwriting,and inputs the figure, etc. (Step S8). In such manner, the figure, etc.can be inputted precisely by compensating the influence exerted on thepen-shaped input apparatus 1 by the inclination angle in the gravitycoordinate system.

Hereupon, although it is assumed that the axis Zg extending in thegravity acceleration direction perpendicularly intersects thehandwriting surface in the above-mentioned embodiment (firstembodiment), if the handwriting surface is not horizontal, an error mayoccur in the above detection result on some occasions.

For instance, assuming that the axis perpendicular to the handwritingsurface is Zr and the axes intersecting perpendicularly to each other onthe handwriting surface perpendicular to Zr are, respectively, Xr and Yras shown in FIG. 4, the coordinate system established by Xr, Yr, and Zris defined as the handwriting surface coordinates system. Assuming thatthe angle formed by the Xr axis and the Xg axis is q and the deviations(displacements) in the Xg-axis direction and the Zg-axis direction are,respectively, Dx and Dz, the relationship therebetween satisfies thefollowing equation:

    θ=arc tan (Δz/Δx)                        (10

And further, the value of Δ(xz) can be obtained by the following twoequations:

    Δ(xz)=(Δx) cos θ,                        (11

and

    Δ(xz)=(Δz) sin θ                         (12

The movement amount compensating section 49 performs, the aboveoperational calculation, wherein it may be allowed to compensate themovement distance in case that the handwriting surface is nothorizontal.

And further, when the inclination angle of the pen-shaped inputapparatus 1 varies during handwriting, the acceleration caused by theinclination angle variation of the pen-shaped input apparatus 1 to theaccelerations applied to the acceleration sensors 2a, 2b, and 2c variesas the result thereof. An acceleration compensating section 50 may alsobe provided for calculating the variation value of the accelerationcaused by the inclination angle variation on the basis of the variationvalue of the inclination angle during handwriting detected by thehandwriting inclination angle calculating section 46 and the mountingposition of the acceleration sensors 2a, 2b, and 2c, as shown in FIG. 5.For instance, consider the case of rotating the pen-shaped inputapparatus by q (radian) in the direction of arrow B around the pen's tipend, as shown in FIG. 6.

The acceleration sensor 2 is located on the position separated by adistance r1 from the pen's tip end 8. Assuming that the rotationalangular velocity detected by the gyroscope 3 is w (radian), theacceleration a1 applied to the acceleration sensor 2 caused by theinclination thereof turns out to be ##EQU9##

The acceleration compensating section 50 can obtain (calculate) theactual acceleration by subtracting the acceleration al applied to theacceleration sensor 2 caused by the above-mentioned inclination from theacceleration detected by the acceleration sensor 2.

Furthermore, when the inclination angle of the pen-shaped inputapparatus 1 varies during handwriting, the centrifugal force occurringat this time exerts an influence on the accelerations detected by theacceleration sensors 2a, 2b, and 2c, on some occasions. On thoseoccasions, it may be allowed to compensate the influence exerted on theaccelerations detected by the acceleration sensors 2a, 2b, and 2c due tothe above-mentioned centrifugal force by use of the accelerationcompensating section 50. For instance, assuming that the accelerationsensor 2c for detecting the acceleration in the Zs-shaft direction islocated at the position apart by r1 from the pen's tip end, theacceleration caused by the centrifugal force turns out to be -(r1)×w².The acceleration compensation section 50 subtracts the accelerationcaused by the centrifugal force from the acceleration detected by theacceleration sensor 2c and thereby compensates the detection error.Moreover, although the acceleration in the Zs direction is thuscompensated in the above embodiment (first embodiment), theaccelerations in the Xs axis and the Ys axis can be compensated also ina similar way.

Furthermore, when the pen shaft coordinates system does not coincidewith the handwriting surface coordinates system as shown in FIG. 7, thecoordinates of the origin at the pen's tip end 8 deviates by d andthereby the entire handwritten figure gets out of position on someoccasions. It may be also allowed to obtain (calculate) the deviationvalue d=(r1)×cosθ by use of the coordinates compensating section 51 andthereby compensate the origin coordinates thereof.

C. Modification of First Embodiment

Next, a modification of the first embodiment is described below. In themodification, shown in FIG. 8, the pen-shaped input apparatus 1b isdivided into the apparatus main body 1c and the inclination angledetecting apparatus 1d and both sections are connected to each other bya communication cable 11, and the inclination angle formed between theapparatus main body 1c and the handwriting surface 10 is detected by theinclination angle detecting apparatus 1d mounted on the handwritingsurface 10.

As shown in FIG. 9, the apparatus main body 1c comprises threeacceleration sensors 2a, 2b, and 2c and an operational calculatingsection 4b. The three acceleration sensors 2a, 2b, and 2c respectivelydetect, as described above, the accelerations in the Xs axis, the Ysaxis, and the Zs axis. The operational calculating section 4b comprisesa coordinates conversion calculating section 47 and a movement amountcalculating section 48. The coordinates conversion calculating section47 converts the acceleration in the pen shaft coordinate system detectedby the acceleration sensors 2a, 2b, and 2c to the acceleration in thehandwriting surface coordinate system on the basis of the inclinationangle in the handwriting surface coordinate system of the handwritingpen shaft 8 detected by the inclination angle detecting apparatus 1d.

The movement amount calculating section 48 calculates the movementdirection and the movement distance of the pen's tip end 8 on the basisof the acceleration thus converted by the coordinates conversioncalculating section. In such structure, the construction of theapparatus main body 1c can be simplified and the accuracy of detectingthe inclination angle can be raised.

Regarding the above-mentioned first and modified embodiments, thefollowing advantageous functional effects are acheived. As is apparentfrom the foregoing description of the accelerations in the X-axisdirection, the Y-axis direction, and the Z-axis direction in the case ofassuming that the pen shaft is the Z axis are respectively converted toacceleration(s) in the gravity coordinate system, and then the movementdirection and the movement distance of the pen's tip end are calculatedon the basis of the acceleration thus converted. Consequently, themovement direction and the movement distance of the tip end of the penmoving on the handwriting surface can be detected precisely with asmall-sized apparatus.

Furthermore, since the movement distance of the pen's tip end iscompensated to the movement distance on the handwriting surface on thebasis of the angle formed between the handwriting plane surface and thehorizontal plane surface, the movement direction and the movementdistance of the pen's tip end can be detected precisely even in casethat the handwriting surface is not horizontal.

Furthermore, the high-frequency component of the signal from theacceleration sensors and the gyroscopes above the neighborhood of 10 Hzis transmitted, and the start and end of the handwriting are judged onthe basis of the high-frequency component thus transmitted.Consequently, the start and end of the handwriting can be detectedprecisely.

Furthermore, the variation value of the acceleration due to thevariation of the inclination angle is calculated on the basis of thevariation value of the inclination angle during handwriting and themounting position of the acceleration sensor and the accelerationdetected by the acceleration sensor is compensated. Consequently, theacceleration can be detected precisely.

Furthermore, the centrifugal force caused by the variation of theinclination angle is calculated on the basis of the variation value ofthe inclination angle during the handwriting and the mounting positionof the acceleration sensor and further the variation value of theacceleration due to the variation of the inclination angle on the basisof the calculated centrifugal force, and then the component of thecentrifugal force accompanying the variation of the inclination angle ofthe acceleration detected by the acceleration sensor is compensated.Consequently, the acceleration can be more precisely detected.

Furthermore, the error (difference) between the coordinates of theacceleration on the handwriting plane surface and the coordinates of thepen's tip end is compensated on the basis of the inclination angleduring the handwriting and the mounting position of the accelerationsensor. Consequently, the occurrence of the deviation (getting out ofposition) of the entire inputting figure can be prevented.

And further, since the inclination angle formed between the apparatusmain body and the handwriting surface is detected on the handwritingsurface, the construction of the apparatus main body can be simplifiedand the accuracy of detecting the inclination angle can be raised.

D. Detailed Description of the Second Embodiment

The pen-shaped input apparatus of the second embodiment according to thepresent invention comprises three acceleration sensors, three gyroscopesand an operational calculating section. The three acceleration sensorsrespectively output the signals showing the accelerations in theXs-axis, Ys-axis, and Zs-axis directions of the pen-shaped coordinatesystem (Xs, Ys, Zs) around the Zs axis of the pen shaft. The threegyroscopes respectively output the signals showing the rotationalangular velocity around the Xs axis, Ys axis, and Zs axis.

The operational calculating section comprises an initial inclinationangle calculating section, an inclination angle variation calculatingsection, a handwriting inclination angle calculating section, anacceleration compensating section, a coordinates conversion calculatingsection, and a movement amount calculating section.

The initial inclination angle calculating section calculates the initialvalue of the pen shaft inclination angle in the gravity coordinatesystem (Xg, Yg, Zg) around the Zg axis extending in the gravityacceleration direction on the basis of the acceleration detected by thethree acceleration sensors when the input apparatus is in a state ofnon-handwriting.

The inclination angle variation calculating section calculates thevariation of the inclination angle of the pen shaft in the gravitycoordinate system (Xg, Yg, Zg) on the basis of the rotational angularvelocity detected by the three gyroscopes when the input apparatus is ina state of handwriting.

The handwriting inclination angle calculating section calculates theinclination angle of the handwriting pen shaft in the gravitycoordinates system (Xg, Yg, Zg) on the basis of the initial value of theinclination angle calculated by the initial inclination anglecalculating section and the variation of the inclination anglecalculated by the inclination angle variation calculating section.

The acceleration compensating section compensates the accelerationsensed at the mounting positions of the three acceleration sensors inthe pen shaft coordinates system (Xs, Ys, Zs) to acceleration at thepen's tip end, on the basis of the mounting positions of the threeacceleration sensors, the rotational angular velocity detected by thethree gyroscopes, the inclination angle variation of the pen shaftcalculated by the inclination angle variation calculating section, andthe inclination angle of the handwriting pen shaft calculated by thehandwriting inclination angle calculating section.

The coordinates conversion calculating section converts the accelerationin the pen shaft coordinate system (Xs, Ys, Zs), compensated by theacceleration compensating section, to the acceleration in the gravitycoordinate system (Xg, Yg, Zg), on the basis of the inclination angle inthe gravity coordinate system (Xg, Yg, Zg) of the handwriting pen shaftdetected by the handwriting inclination angle calculating section. Themovement amount calculating section calculates the movement directionand the movement distance of the pen's tip end on the basis of theacceleration converted by the coordinates conversion calculatingsection.

Consequently, the influence exerted by the inclination angle of theapparatus and the mounting position of the acceleration sensors can becompensated, and thereby the handwriting input operation can beperformed more precisely and simply.

The acceleration sensor of the Xs-axis direction is disposed on theposition of Ys=0, the acceleration sensor of the Ys-axis direction isdisposed on the position of Xs=0, and the acceleration sensor of theZs-axis direction is disposed on the Zs axis, in order to simplify thecalculation of the operational calculating section.

Furthermore, the respective acceleration sensors are arranged on thepositions near the Zs axis, in order to reduce the amount of thecalculation and thereby shorten the calculating time.

Furthermore, the pen-shaped input apparatus comprises a high-pass filterfor transmitting the high-frequency component of the signals from thethree acceleration sensors and the three gyroscopes generated by theaction of the friction between the pen's tip end and the handwritingsurface, judges the start of handwriting on the basis of any of thesignals from the three acceleration sensors and the three gyroscopespassing through the high-pass filters which contain the high-frequencycomponent, e.g. 100 Hz, for the first time, and judges the end ofhandwriting on the basis of the disappearance, after some predeterminedthreshold time period of all high frequency component signals from thethree acceleration sensors and the three gyroscopes. In such manner, theprehandwriting condition as well as the handwriting start and thehandwriting end can be detected with a simple construction.

Furthermore, the pen-shaped input apparatus comprises a handwritingorbit extracting section and a fitting section. The handwriting orbitextracting section extracts the orbit of the pen's tip end from thestart of handwriting to the end thereof in accordance with the movementdirection and the movement distance of the pen's tip end calculated bythe movement amount calculating section. The fitting section transfersthe image of the orbit of the pen's tip end extracted by the handwritingorbit extracting section onto the handwriting surface, and therebycompensates the influence due to the inclination of the handwritingsurface.

And further, the movement amount calculating section calculates themovement distances in the Xg direction and the Yg direction, and thehandwriting orbit extracting section extracts the orbit of the pen's tipend from the start of handwriting to the end thereof in accordance withthe movement distances in the Xg direction and the Yg direction of thepen's tip end calculated by the movement amount calculating section. Insuch manner, the influence due to the inclination of the handwritingsurface can be accommodated with a simple construction.

The pen-shaped input apparatus of the second embodiment is capable ofinputting characters, symbols, and figures, etc. into a computerapparatus or the like. The pen-shaped input apparatus of the secondembodiment detects the accelerations in the Xs-axis direction, theYs-axis direction, and the Zs-axis direction of the pen shaft coordinatesystem having the pen shaft as the Zs axis, and thereby the movementdirection and the movement distance of the pen's tip end on the basis ofthe acceleration thus detected in the Xs-axis direction, the Ys-axisdirection, and the Zs-axis direction. The error due to the mountingposition of the acceleration sensors and other errors due to theinclination of the apparatus are included in the accelerations detectedby the acceleration sensors.

FIG. 10 is a structure view showing the second embodiment according tothe present invention.

As shown in FIG. 10, the above pen-shaped input apparatus 101 comprisesacceleration sensors 102a, 102b, and 102c, gyroscopes 103a, 103b, and103c, an operational calculating section 104, a storage section 105, anda power supply section 106.

The acceleration sensors 102a, 102b, and 102c are respectively arrangednear the Zs axis in the directions of the Xs axis, the Ys axis, and theZs axis, on the assumption that the pen shaft 107 is the Zs axis,respectively detect the accelerations in the directions of the Xs axis,the Ys axis, and the Zs axis, and respectively output the signalsshowing the detected accelerations. A piezoelectric voltage system,electrostatic capacitance system, or piezoelectric resistance system maybe used as the acceleration sensors 102a, 102b, and 102c. The gyroscopes103a, 103b, and 103c respectively detect the rotational angularvelocities around the Xs axis, the Ys axis, and the Zs axis andrespectively output the signals showing the detected rotational angularvelocities.

As in the first embodiment, the coordinate system of pen shaft 107 asthe Zs axis is called the pen shaft coordinate system (Xg, Yg, Zg), andthe two axes perpendicular to the Zs axis and to each other arerespectively called the Xs axis and the Ys axis. And further, thecoordinate system of the axis extending in the gravity accelerationdirection as the Zg axis is called the gravity coordinate system (Xg,Yg, Zg), and the two axes perpendicular to the Zg axis and to each otherare respectively called the Xg axis and the Yg axis. Furthermore, theangles formed between the Xs axis and the Ys axis, between the Zs axisand the Xg axis, and between the Yg axis and the Zg axis arerespectively called φ, θ, and ψ.

As shown in FIG. 11, the operational calculating section 104 for thesecond embodiment comprises A/D converters 141a-141f, low-pass filters142a-142f, high-pass filters 143a-143f, a static (state) judgmentsection 144, an initial inclination angle calculating section 145, aninclination angle variation calculating section 146, a handwritinginclination angle calculating section 147, an acceleration 10compensating section 148, a coordinates conversion calculating section149, a gravity acceleration removing section 150, a movement amountcalculating section 151, a handwriting orbit extracting section 152, anda fitting section 153.

The A/D converters 141a-141f convert, respectively, the analog signalsfrom the acceleration sensors 102a, 102b, and 102c and the gyroscopes103a, 103b, and 103c to digital signals. The low-pass filters 142a-142fintercept the high-frequency component of the signals from theacceleration sensors 102a, 102b, and 102c and from the gyroscopes 103a,103b, and 103c caused by the frictional force between the pen's tip end108 and the surface to be handwritten. The high-pass filters 143a-143fextract the high-frequency component of the signals from theacceleration sensors 102a, 102b, and 102c and from the gyroscopes 103a,103b, and 103c, for instance, at frequencies above the neighborhood of10 Hz caused by the frictional force.

The static state judgment section 144 judges the beginning of ahandwriting operation when any one of the signals from the threeacceleration sensors 102a, 102b, and 102c and the three gyroscopes 103a,103b, and 103c respectively pass through the high-pass filters 143a-143fwhich contain the high-frequency component, for the first time, andjudges the end of a handwriting operation when there are no longer anysignals from the three acceleration sensors 102a, 102b, and 102c and thethree gyroscopes 103a, 103b, and 103c which pass through the samehigh-pass filters 143a-143f after some predetermined threshold timeperiod.

For instance, the pen's tip end 108 is constructed with the core of thepencil, and the waveform of the acceleration signal when handwriting onthe paper occurs is shown in FIG. 12. As shown in FIG. 12, thehandwriting acceleration component due to pencil movement appears in thepart of comparatively low frequency equal to or lower than the centerfrequency 10 Hz, while the component caused by the friction between thepen's tip end 108 and the writing surface appears in the part ofcomparatively high frequency, e.g. 100 Hz, equal to or higher than 10Hz. In such situation, the high-pass filters 143a-143f respectivelyextract the components of the frequency above 10 Hz, and the staticstate judgment section 144 compares the signals thus extracted by thehigh-pass filters 143a-143f with a previously determine threshold value,and thereby judges whether the pen-shaped input apparatus performs ahandwriting operation.

Hereupon, depending on the direction of the handwriting, since adifference appears in the components caused by the pen's tip end 108 andthe surface to be handwritten respectively detected by the accelerationsensors 102a, 102b, and 102c and the gyroscopes 103a, 103b, and 103c,the static state judgment section 144 judges the start of handwriting onthe basis of the presence of any one of the signals containing thehigh-frequency component for the first time, and the same judges the endof handwriting when the last of any one of the signals containing thehigh-frequency component is no longer present for a threshold period.

The initial inclination angle calculating section 145 calculates theinitial values φ₀, θ₀, and ψ₀ of the inclination angle in the gravitycoordinate system (Xg, Yg, Zg) of the pen shaft 107 on the basis of theaccelerations in the pen shaft coordinate system (Xs, Ys, Zs) detectedby the three acceleration sensors 102a, 102b, and 102c in a state ofnon-handwriting.

The inclination angle variation calculating section 146 calculates thevariations Δφ, Δθ, and Δψ of the inclination angles in the gravitycoordinate system (Xg, Yg, Zg) of the pen shaft 107 on the basis of therotational angular velocities detected by the three gyroscopes 103a,103b, and 103c in a state of handwriting.

The handwriting inclination angle calculating section 147 obtains theinclination angles φ, θ, and ψ in the gravity coordinate system (Xg, Yg,Zg) of the pen shaft 108 during the handwriting on the basis of theinitial values φ₀, θ₀, and ψ₀ of the inclination angles in the gravitycoordinate system (Xg, Yg, Zg) of the pen shaft 107 calculated by theinitial inclination angle calculating section 145 and the variations Δφ,Δθ, and Δψ of the inclination angles in the gravity coordinate system(Xg, Yg, Zg) of the pen shaft 107 calculated by the inclination anglevariation calculating section 141.

The acceleration compensating section 148 compensates the accelerationson the mounting position of the three acceleration sensors 102a, 102b,and 102c in the pen shaft coordinate system (Xs, Ys, Zs) to theaccelerations of the pen's tip end 108 on the basis of the mountingposition of the three acceleration sensors 102a, 102b, and 102c, therotational angular velocities detected by the three gyroscopes 103a,103b, and 103c, the inclination angle variation of the pen shaft 107calculated by the inclination angle variation calculating section 146,and the inclination angle of the pen shaft 107 during handwritingcalculated by the handwriting inclination angle calculating section 147.

The coordinates conversion calculating section 149 converts theacceleration in the pen shaft coordinate system (Xs, Ys, Zs) compensatedby the acceleration compensating section 148 to the acceleration in thegravity coordinate system (Xg, Yg, Zg) on the basis of the inclinationangles φ, θ, and ψ in the gravity coordinates system (Xg, Yg, Zg) of thepen shaft 107 during handwriting detected by the handwriting incinationangle calculating section 147.

The gravity acceleration removing section 150 removes the gravityacceleration component from the acceleration converted by thecoordinates conversion calculating section 149.

The movement amount calculating section 151 calculates the movementdirection and the movement distance of the pen's tip end 108 on thebasis of the acceleration, from which the gravity acceleration removingsection 150 removes the gravity acceleration component.

The handwriting orbit extracting section 152 extracts the orbit of thepen's tip end 108 from the start of handwriting to the end ofhandwriting in accordance with the movement direction and the movementdistance of the pen's tip end 108 calculated by the movement amountsection 151.

The fitting section 153 image-transfers the orbit of the pen's tip end108 extracted by the handwriting orbit extracting section 152 and storedin the storage section 105 to the surface to be handwritten.

Now, the operational calculation of the calculating section 104 isdescribed hereinafter. Coordinate converting equations for convertingthe gravity coordinate system (Xg, Yg, Zg) to the pen shaft coordinatesystem (Xs, Ys, Zs) are as follows: ##EQU10## a₁₁ =cosθcosψa₂₁=sinφsinθcosψ-cosφsinψ

a₃₁ =cosφsinθcosψ+sinφsinψ

a₁₂ =cosθsinψ

a₂₂ =sinφsinθsinψ+cosφcosψ

a₃₂ =cosφsinθsinψ-sinφcosψ

a₁₃ =-sinθ

a₂₃ =sinφcosθ

a₃₃ =cosφcosθ

If the above equation (equation 13) is converted by the coordinatesconversion formula from the pen shaft coordinate system (Xs, Ys, Zs) tothe gravity coordinate system (Xg, Yg, Zg), the following equation(equation 14) can be obtained. ##EQU11##

Here, the coordinates (Xga, Yga, Zga) in the gravity coordinate system(Xg, Yg, Zg) at a point A shown in FIG. 13 can be expressed by thefollowing equation (equation 15) including the coordinates (Xgo, Ygo,Zgo) in the gravity coordinates system (Xg, Yg, Zg) of the pen's tip end108, the coordinates (Lx, Ly, Lz) in the pen shaft coordinates system(Xs, Ys, Zs) at the point A, and the inclination angles φ, θ, and ψ.##EQU12##

The above equation (equation 15) differentiated two times by timerepresents the accelerations (Axg, Ayg, Azg) in the gravity coordinatessystem (Xg, Yg, Zg) of the point A (Xga, Yga, Zga). Here, since theinclination angles φ, θ, and ψ are also functions of the time, thefollowing equations (equation 16) can be obtained. ##EQU13##

Furthermore, the force of gravity is exerted in the Zg-axis direction inthe gravity coordinate system (Xg, Yg, Zg) regardless of the movement ofthe pen's tip end 108, and then, if the gravity acceleration g is addedto the above equation (equation 16), the following equation (equation17) can be obtained. ##EQU14##

Assuming that the acceleration sensors 102a, 102b, and 102c are arrangedat the point A, the accelerations (Axsa, Aysa, Azsa) detected by theacceleration sensors 102a, 102b, and 102c can be expressed by thefollowing equations (equations 18a, 18b). ##EQU15##

Next, assuming that the acceleration sensors 102a, 102b, and 102c arearranged respectively at the points B, C, and D, and the coordinates inthe pen shaft coordinate system (Xs, Ys, Zs) at the points B, C, and Dare, respectively, B (Lxx, Lxy, Lxz), C (Lyx, Lyy, Lyz), and D (Lzx,Lzy, Lzz), the second term of the equations 18 is replaced by thefollowing equation (equation 19). ##EQU16##

From the above equation (equation 19), the accelerations (Axs, Ays, Azs)detected by the respective acceleration sensors 102a, 102b, and 102c canbe expressed by the following equation (equation 20). ##EQU17##

The acceleration compensating section 148 performs the operationalcalculation of the second term of the above equations (equation 20) andcompensates the accelerations (Axs, Ays, Azs) detected by the respectiveacceleration sensors 102a, 102b, and 102c. And further, after thecoordinates conversion calculating section 149 performs the coordinatesconversion of the compensated acceleration, the gravity accelerationremoving section 150 removes the gravity acceleration component, andthereby the acceleration (Axgo, Aygo, Azgo) of the pen's tip end 108 canbe obtained.

Here, the accelerations (Axgo, Aygo, Azgo) in the gravity coordinatessystem (Xg, Yg, Zg) of the pen's tip end 108 can be expressed by thefollowing equation (equation 21) obtained by differentiating two timesthe movement distances (Xgo, Ygo, Zgo) in the gravity coordinate system(Xg, Yg, Zg). ##EQU18##

The movement amount calculating section 151 integrates two times thethus calculated accelerations (Axgo, Aygo, Azgo) in the gravitycoordinate system (Xg, Yg, Zg) of the pen's tip end 108 and therebyobtains the orbit of the pen's tip end 108.

Next, the initial values (φ₀, θ₀, ψ₀) of the inclination angle areexplained. Since only the gravity accelerations are exerted in a staticstate, the accelerations (Axs, Ays, Azs) in the pen shaft coordinatesystem (Xs, Ys, Zs) can be obtained with the equation of differentiatingtwo times the movement distances (Xs, Ys, Zs). The equation (equation22) is as follows: ##EQU19##

As mentioned above, in a static state, the accelerations (Axs, Ays, Azs)in the pen shaft coordinate system (Xs, Ys, Zs) detected by theacceleration sensors 102a, 102b, and 102c is not affected depending onthe mounting position of the acceleration sensor. Here, since threeequations can be established for the two unknown figures φ₀ and θ₀, thegravity acceleration g can be also treated as the unknown figure.Furthermore, it is possible also to calculate the value of the gravityacceleration g and judge whether the calculation is good or bad on thebasis of the variation of the value calculated adding the function ofmonitoring. Furthermore, the relationship between the rotational angularvelocities (P, Q, R) of the angle axis of the pen shaft coordinatessystem (Xs, Ys, Zs) and the variation of the inclined angular velocities(φ, θ, ψ) can be expressed by the following equations (equations 23a,23b, 23c):

    φ=P+Q sin φ tan θ+R cos φ tan θ    (23a

    θ=Q cos θ-R sin ψ                          (23b

    ψ=Q sin φsecθ+R cos φsecθ          (23c

Here, it is possible also to express the accelerations (Axgo, Aygo,Azgo) of the pen's tip end 108 capable of being obtained with theequation of differentiating the movement distances (Xgo, Ygo, Zgo) inthe gravity coordinates system (Xg, Yg, Zg) of the pen's tip end 108 bythe following equations (equation 24a, 24b). ##EQU20##

The operation of the pen-shaped input apparatus 101 is explainedhereinafter referring to the flow chart in FIG. 14.

The acceleration sensors 102a, 102b, and 102c respectively detect theaccelerations in the Xs direction, the Ys direction, and the Zsdirection. The high-pass filters 143a-143f extract the high-frequencycomponent above the neighborhood of 10 Hz of the signals from theacceleration sensors 102a, 102b, and 102c and the gyroscopes 103a, 103b,and 103c respectively inputted through the A/D converters 141a-141f. Thestatic state judgment section 144 outputs the signal showing whether thehandwriting is being performed on the basis of the signals from thehigh-pass filters 143a-143f. In such manner, since the high-frequencysignals are caused by the frictional force between the pen's tip end 108and the writing surface, it is easy to precisely detect when handwritinghas started by detecting these high-frequency signals and when it hasended by detecting the absence of the high frequency signals for somethreshold time period.

The initial inclination angle calculating section 145 inputs the signalsfrom the acceleration sensor 102a of the Xs axis, the accelerationsensor 102b of the Ys axis, and the acceleration sensor 102c when thesection 145 does not receive any signal showing that a "handwriting"operation is in effect and calculates the initial values φ₀, θ₀, and ψ₀of the inclination angle in the gravity coordinate system of the penshaft 107 (Step S101).

When the inclination angle variation calculating section 146 receivesthe signal showing a "handwriting" operation from the static statejudgment section 144 (Step S102), the section 146 calculates thevariations Δφ,Δθ, and Δψ of the inclination angle in the gravitycoordinates system (Xg, Yg, Zg) of the pen shaft 107 on the basis of therotational angular velocity detected by the three gyroscopes 103a, 103b,and 103c (Step S103).

The handwriting inclination angle calculating section 147, as mentionedabove, obtains the inclination angles (φ, θ, ψ) of the handwriting penshaft 107 (Step S104) on the basis of the initial values φ₀, θ₀, and ψ₀of the inclination angle of the pen shaft 107 calculated by the initialinclination angle calculating section 145 and the variations of theinclination angles (φ, θ, ψ) of the pen shaft 108 calculated by theinclination angle variation calculating section 145.

The acceleration compensating section 148 compensates the accelerations(Axso, Ayso, Azso) of the pen shaft (Xs, Ys, Zs) detected by the threeacceleration sensors 102a, 102b, and 102c to the accelerations (Axso,Ayso, Azso) at the pen's tip end 108 (Step S105) on the basis of thecoordinates (Lxx, Lxy, Lxz), (Lyx, Lyy, Lyz), and (Lzx, Lzy, Lzz) of themounting position of the three acceleration sensors 102a, 102b, and102c, the variations of the inclination angles (φ, θ, ψ) of the penshaft 7 calculated by the inclination angle variation calculatingsection 146, and the inclination angles (φ, θ, ψ) of the handwriting penshaft 107 calculated by the handwriting inclination angle calculatingsection 147.

The coordinates conversion calculating section 149 converts theaccelerations (Axso, Ayso, and Azso) compensated by the accelerationcompensating section 148 to the accelerations (Axgo, Aygo, Azgo) in thegravity coordinate system (Xg, Yg, Zg) (Step S106) on the basis of thehandwriting inclination angles (φ, θ, ψ) detected by the handwritinginclination angle calculating section 147.

In such manner, since the mounting position of thee acceleration sensors102a, 102b, and 102c and the influence due to the inclination arecompensated, it is possible to detect precisely the acceleration in thegravity coordinate system (Xg, Yg, Zg) at the pen's tip end 108.

The gravity acceleration removing section 150 removes the gravityacceleration component from the accelerations (Axgo, Aygo, Azgo)converted by the coordinates conversion calculating section 149 (StepS107).

The movement amount calculating section 151 calculates the movementdirection and the movement distance of the pen's tip end 108 (Step S108)by integrating twice the accelerations (Axgo, Aygo, Azgo) at the pen'stip end 108 after a gravity acceleration component is removed by thegravity acceleration removing section 150.

In such manner, since the integration is performed after compensatingthe accelerations (Axs, Ays, Azs) detected by the acceleration sensors102a, 102b, and 102c, it may be possible to reduce the error caused bythe result of the integration.

The handwriting orbit extracting section 152 extracts the orbit of thepen's tip end 108 from the start of the handwriting to the end thereoffrom the movement direction and the movement distance of the pen's tipend 108 calculated by the movement amount calculating section 151 andmemorizes the extracted orbit in the storage section 105 (Steps S109,S110).

The fitting section 153 specifies the surface to be handwritten from theorbit of the pen's tip end 108 extracted by the handwriting orbitextracting section 152, for instance, by use of the minimum squaringmethod, and transfers the image of the orbit of the pen's tip end 108onto the surface to be handwritten (Step S111).

For instance, if the three-dimensional data (Xi, Yi, Zi) of thehandwriting orbit as shown in FIG. 15a are put into the equation;aX+bY+cZ+d=0, an equation; aXi+bYi+cZi+d=δi can be obtained, and thesurface to be handwritten (a, b, c, d) is specified so as to minimizethe squaring sum of the error Σ(δi)². Here, as shown in FIG. 15b, theerror di becomes the shortest distance between the coordinates (Xi, Yi,Zi) and the surface to be handwritten. In such manner, it is possible toinput precisely the movement distance on the handwriting surface of thepen's tip end 108 even when the handwriting surface is inclined, bytransferring the orbit of the pen's tip end 108 onto the handwritingsurface.

The pen-shaped input apparatus 101 repeats the above-mentionedoperations (Steps S103-S111) until the static state judgment section 144does not detect the high-frequency component from the accelerationsensors 102a, 102b, and 102c or the gyroscopes 103a, 103b, and 103c(Step S112) after a threshold period of time, and thereby preciselyinputs characters and figures, etc. into a computer or the like.

Moreover, in the above second embodiment, although the coordinates ofthe acceleration sensors 102a, 102b, and 102c are (Lxx, Lxy, Lxz), incase that the Xs-axis direction acceleration sensor 102a is disposed onthe position of Ys=0, Ys-axis direction acceleration sensor 102b isdisposed on the position of Xs=0, and the Zs-axis direction accelerationsensor 102c is disposed on the Zs axis, the coordinates of theacceleration sensors 102a, 102b, and 102c become (Lxx, 0, Lxz), (0, Lyy,Lyz), and (0, 0, Lzz).

The accelerations (Axgo, Aygo, Azgo) which can be obtained bydifferentiating twice the movement distances (Xgo, Ygo, Zgo) in thegravity coordinate system (Xg, Yg, Zg) of the pen's tip end 108 can beexpressed by the following equation (equation 25), and it may bepossible to reduce the compensation calculating amount of theacceleration detected by the acceleration sensors 102a, 102b, and 102c.##EQU21##

Here, when the Xs-axis direction acceleration sensor 102a is disposed onthe position of Xs=0, the Ys-axis direction acceleration sensor 102b isdisposed on the position of Ys=0, and the Zs-axis direction accelerationsensor 102c is disposed on the Zs axis, the coordinates of theacceleration sensors 102a, 102b, and 102c become (0, Lxy, Lxz), (Lyx, 0,Lyz), and (0, 0, Lzz), and the accelerations (Axgo, Aygo, Azgo) whichcan be obtained with the equation of differentiating twice the movementdistances (Xg, Yg, Zg) in the gravity coordinate system (Xg, Yg, Zg) ofthe pen's tip end 108 can be expressed by the following equation(equation 26): ##EQU22##

And further, if the respective sensors 102a, 102b, and 102c are arrangedon the Zs axis, (all of) Lxx, Lxy, Lyx, Lyy, Lzx, and Lzy become 0(zero). Therefore, the coordinates of the acceleration sensors 102a,102b, and 102c turn out to be (0, 0, Lxz), (0, 0, Lyz), and (0, 0, Lzz),and the accelerations (Axgo, Aygo, Azgo) which can be obtained with theequation of differentiating twice the movement distance (Xgo, Ygo, Zgo)in the gravity coordinates system (Xg, Yg, Zg) of the pen's tip end 108can be expressed by the following equation (equation 27), and further itmay be possible to reduce the compensation calculating amount of theacceleration. ##EQU23##

And further, as shown in FIGS. 16 through 18, since the specifiedelement of the compensation term has a large acceleration component, itmay be allowed to calculate the accelerations (Axgo, Aygo, Azgo) in thegravity coordinate system (Xg, Yg, Zg) of the pen's tip end 108 with thefollowing equation (equation 28) by use of only the specified element.Thereby, the time of the calculation can be further shortened.

For instance, Lxx (d² θ/dt²) cosφ is employed as the compensationelement of the Xs-axis direction acceleration, Lyz {(d² ψ/dt²) sin(φ-θ)} is employed as the compensation element of the Ys-axis directionacceleration, and -Lzz {(dφ/dt)² +(dθ/dt)² cos² φ} is employed as thecompensation element of the Zs-axis direction acceleration. ##EQU24##

Furthermore, in this second embodiment, the fitting section 153 makesshortest the distance between the coordinates (Xi, Yi, Zi) and transfersthe image of the orbit of the pen's tip end 108 onto the handwritingsurface. However, for instance as shown in FIG. 19, it may be allowedalso to make shortest the distance between the coordinates (Xi, Yi, Zi)and the handwriting surface in the Zg-axis direction.

For instance, the equation showing the handwriting surface is (a₁X+(b₁)Y+Z+d₁ =0, and the three-dimensional data (Xi, Yi, Zi) of thehandwriting orbit are put into (substituted for) the above equation, andthereby an equation; (a₁)×(Xi)+(b₁)×(Yi)+(Zi)+(d₁)=σi can be obtained.And then, the handwriting surface (a₁, b₁, d₁) is specified so as tomake minimum the squaring sum Σ(σi)² of the above error.

In such manner, the calculating time can be shortened by decreasing theparameter by one. On this occasion, although an error occurs when thehandwriting surface is vertical, in the using status of the ordinarypen-shaped input apparatus 101, the handwriting surface is scarcely madevertical.

Furthermore, it may be allowed that the movement amount calculatingsection 151 calculates only the movement distances in the Xg directionand the Yg direction of the pen's tip end on the basis of theacceleration converted by the coordinates conversion calculating section149, the handwriting orbit extracting section 102 extracts the orbit ofthe pen's tip end from the start of handwriting to the end thereof inaccordance with the movement distances in the Xg direction and the Ygdirection of the pen's tip end 108 calculated by the movement amountcalculating section 151, and thereby the influence due to theinclination of the handwriting surface is compensated with a simplestructure. On this occasion, it is not necessary to provide the gravityacceleration removing section 150 and the fitting section 153.Furthermore, the calculation time expensed in those sections can beshortened, and further the general calculation time can be largelyshortened because it is not necessary to perform the movement amountcalculating process in the Zg direction by the movement amountcalculating section 151.

As is apparent from the foregoing description, in the second embodimentaccording to the present invention, since the inclination angle of thehandwriting pen shaft is calculated on the basis of the initial value ofthe inclination angle of the pen shaft and the inclination anglevariation of the pen shaft, the accelerations detected by the threeacceleration sensors are compensated to the acceleration at the pen'stip end on the basis of the mounting positions of the three accelerationsensors, the inclination angle variation of the pen shaft, and theinclination angle of the handwriting pen shaft, the compensatedacceleration in the pen shaft coordinate system is converted to theacceleration in the gravity coordinate system on the basis of theinclination angle of the handwriting pen shaft, and the movementdirection and the movement distance of the pen's tip end are calculatedon the basis of the converted acceleration, it may be possible toprecisely detect the movement direction and the movement distance of thepen's tip end moving on the handwriting surface with a small-sizedapparatus.

Furthermore, since the acceleration sensor of the Xs-axis direction isdisposed on the position of Ys=0, the acceleration sensor of the Ys-axisdirection is disposed on the position of Xs=0, and the accelerationsensor of the Zs-axis direction is disposed on the Zs axis, thecalculating process can be simplified and the calculating time can beshortened.

Furthermore, since the respective sensors are arranged on the placesnear the Zs axis, the calculating amount can be further reduced andthereby the operating time can be shortened.

Furthermore, since the signals from the acceleration sensors and thegyroscopes judge the beginning of handwriting and the end thereof on thebasis of the high-frequency component caused by the friction between thepen's tip end and the handwriting surface, the beginning of handwritingand the end thereof can be precisely detected with a simpleconstruction.

Furthermore, since the orbit of the pen's tip end from the start ofhandwriting to the end thereof is extracted and the extracted orbitimage of the pen's tip end is transferred onto the handwriting surface,the influence due to the inclination of the handwriting surface can becompensated.

Furthermore, since the movement distances in the Xg direction and the Ygdirection of the pen's tip end from the start of handwriting to the endthereof are extracted, the influence due to the inclination of thehandwriting surface can be compensated for a short period of time andwith a simple calculating construction.

E. Detailed Description of the Third Embodiment

The pen-shaped input apparatus relating to the third embodiment of thepresent invention comprises three acceleration sensors, threegyroscopes, and an operational calculating section. The threeacceleration sensors respectively detect the accelerations in theXs-axis direction, Ys-axis direction, and Zs-axis direction of thepen-shaft coordinates system (Xs, Ys, Zs) having a pen shaft as Zs axis.The three gyroscopes respectively detect the rotational angularvelocities around the Xs axis, the Ys axis, and the Zs axis. Theoperational calculating section comprises a handwriting detectingsection, an initial rotational angle calculating section, a rotationalangle variation calculating section, a handwriting rotational anglecalculating section, a coordinates conversion calculating section, and amovement amount calculating section.

The handwriting detecting section detects whether the pen's tip end isbrought into contact with the handwriting surface and thereby detectswhether the pen-shaped input apparatus is in the handwriting state or inthe non-handwriting state.

Furthermore, the initial rotational angle calculating section calculatesthe initial value of the rotational angle of the pen shaft in thegravity coordinates system (Xg, Yg, Zg) having a shaft extending in thegravity acceleration direction as the Zg axis, on the basis of theacceleration detected by the three acceleration sensors when thehandwriting detecting section detects the non-handwriting state.

The rotational angle variation calculating section calculates thevariation of the rotational angle in the gravity coordinate system (Xg,Yg, Zg) of the pen shaft, on the basis of the rotational angularvelocity detected by the three gyroscopes, when the handwriting sectiondetects the handwriting state.

The handwriting rotational angular velocity calculating sectioncalculates the rotational angle in the gravity coordinate system (Xg,Yg, Zg) of the handwriting pen shaft, on the basis of the initial valueof the rotational angle calculated by the initial rotational anglecalculating section and the rotational angle variation calculated by therotational angle variation calculating section.

The coordinate conversion calculating section converts the accelerationin the pen shaft coordinate system (Xs, Ys, Zs) detected by theacceleration sensors to the acceleration in the gravity coordinatesystem (Xg, Yg, Zg), on the basis of the rotational angle in the gravitycoordinate system (Xg, Yg, Zg) of the handwriting calculated by thehandwriting rotational angle calculating section.

The movement amount calculating section calculates the movementdirection and the movement distance at the pen's tip end, on the basisof the acceleration converted by the coordinates conversion calculatingsection.

And further, the handwriting detecting section detects whether the pen'stip end is brought into contact with the handwriting surface, on thebasis of the high-frequency component of the signals from the threeacceleration sensors.

And further, the handwriting detecting section includes a pressuresensor for detecting the stress applied to the pen's tip end from thehandwriting surface, and detects whether the pen's tip end contacts thesurface by detecting the stress from the handwriting surface by use ofthe pressure sensor.

Furthermore, the initial rotational angle calculating section performsseveral times the process of calculating the rotational angle of the penshaft in the gravity coordinate system (Xg, Yg, Zg), on the basis of theacceleration detected by the three acceleration sensors, when thehandwriting detecting section, and the initial rotational anglecalculating section obtains the initial value of the rotational angle ofthe pen shaft when the pen's tip end comes into contact with thehandwriting surface, by averaging the result of the calculation.Thereby, the initial value of the rotation of the pen shaft can becalculated precisely.

Furthermore, the initial rotational angle calculating section comprisesan acceleration variation amount detecting section, a variation amountcomparing section, and an alarming section. The acceleration variationamount detecting section detects the variation amount of theaccelerations detected by the three acceleration sensors. The variationamount comparing section compares the variation amount of theacceleration detected by the acceleration variation amount detectingsection with a predetermined threshold value. The alarming sectionoutputs an alarm signal when the variation amount of the accelerationdetected by the acceleration variation amount detecting section exceedsthe predetermined threshold value, and notifies the probability of theoccurrence of the error detection to the user.

Furthermore, the above-mentioned initial rotational angle calculatingsection performs several times the process of calculating the rotationalangle of the pen shaft in the gravity coordinate system (Xg, Yg, Zg), onthe basis of the accelerations detected by the three accelerationsensors in a state of non-handwriting state excluding theacceleration(s), the variation of which is judged by the variationamount comparing section to exceed the predetermined threshold value,averages the result of the calculation, and obtains the initial value ofthe rotational angle of the pen shaft when the pen's tip end comes intocontact with the handwriting surface by averaging the result of thecalculation. In such manner, the occurrence of the detection error dueto an abnormal value can be prevented.

The pen-shaped input apparatus of the third embodiment of the presentinvention can also input characters, symbols, and figures, etc. into acomputer or the like. The pen-shaped input apparatus of the thirdembodiment detects the accelerations in the X-axis direction, the Y-axisdirection, and the Z-axis direction of the pen shaft coordinate systemhaving the pen shaft in a state of non-handwriting state as the Z axis,and obtains the initial value of the rotational angle of the pen shaftin the gravity coordinate system at the time of bringing the pen's tipend into contact with the handwriting surface having a shaft extendingin the gravity acceleration direction in accordance with the detectedacceleration. And further, the pen-shaped input apparatus detects therotational angular velocities around the X axis, the Y axis, and Z axisin the handwriting pen shaft coordinate system, and calculates thevariation of the rotational angle in the gravity coordinate system ofthe pen shaft. Thereby, the rotational angle in the gravity coordinatesystem of the handwriting pen shaft is obtained, the acceleration in thepen shaft coordinates system is converted to the acceleration in thegravity coordinates system, and the movement direction and the movementdistance can be detected precisely.

The handwriting detecting section includes, for instance, high-passfilters and OR gates. The high-pass filters respectively extract thehigh-frequency component of the signals from the respective accelerationsensors. The OR gates take logical sum of the high-frequency componentof the signals from the respective acceleration sensors transmittedthrough the respective high-pass filters, and detects the contactingstate of the pen's tip end with the handwriting surface in case that anyone or more of the accelerations detected by the respective accelerationsensors contain(s) the high-frequency component. This means that thehigh-frequency component of the signals from the acceleration sensors issensed to determine when there is a writing based on the signalgenerated by the action of the friction between the pen's tip end andthe handwriting surface.

FIG. 20 is a structural view showing a pen-shaped input apparatus of thethird embodiment according to the present invention. As shown in FIG.20, the pen-shaped input apparatus 201 comprises acceleration sensors202a, 202b, and 202c, gyroscopes 203a, 203b, and 203c, an operationalcalculating section 204, a storage section 205, a communicating section206, and a power supply section 207.

The acceleration sensors 202a, 202b, and 202c are respectively disposedin the Xs-axis direction, the Ys-axis direction, and the Zs-axisdirection in case that the pen shaft 208 is the Zs shaft. The Xs axisand the Ys axis intersect perpendicularly to the Zs axis and to eachother, and detect the acceleration in the X-axis, Y-axis, and Z-axisdirections at the pen's tip end 209. A piezoelectric sensor, anelectrostatic capacitance sensor, or a piezo-resistance sensor can beused as the acceleration sensors 202a, 202b, and 202c.

The gyroscopes 203a, 203b, and 203c respectively detect the rotationalangular velocity around the Xs axis, the Ys axis, and the Zs axis.

The coordinate system having a pen shaft as the Zs axis is called a "penshaft coordinate system", and the two axes intersecting perpendicularlyto the pen shaft 208 and to each other are explained as the Xs axis andthe Ys axis. And further, the coordinate system having an axis extendingin the gravity acceleration direction as Zg axis is called a "gravitycoordinate system", and the two axes intersecting perpendicularly to Zgaxis and to each other are called, respectively, Xg axis and Yg axis.The angles formed between the Xs axis and the Ys axis, between the Zsaxis and the Xg axis, and between the Yg axis and the Zg axis are,respectively, θ, φ and ψ.

Furthermore, in the following description, "inputting" signifies aseries of operations of inputting characters, symbols and figures, etc.,and includes both the case where the pen's tip end is brought intodirect contact with the handwriting surface and the case where the pen'stip end is separated from the handwriting surface. On the other hand,"handwriting" signifies only the former case.

As shown in FIG. 21, the operational calculating section 204 comprisesA/D converters 241a-241f, low-pass filters 242a-242f, a handwritingdetecting section 243, an initial rotational angle calculating section244, a rotational angle variation calculating section 245, a handwritingrotational angle calculating section 246, a coordinates conversioncalculating section 247, and a movement amount calculating section 248.The A/D converters 241a-241f respectively convert the analog signalsfrom the acceleration sensors 202a, 202b, and 202c and the gyroscopes203a, 203b, and 203c to digital signals. The low-pass filters 242a-242fintercept the high-frequency component of the signals from theacceleration sensors 202a, 202b, and 202c and the gyroscopes 203a, 203b,and 203c all generated by the action of the frictional force between thepen's tip end 209 and the handwriting surface.

The handwriting detecting section 243 comprises, for instance, as shownin FIG. 22, high-pass filters 431, 432, and 433 and an OR gate 434. Thehigh-pass filters 431, 432, and 433 extract the high-frequency componentof the signals from the acceleration sensors 202a, 202b, and 202cgenerated by the action of the friction, for instance, frequencies above10 Hz. Here, the high-frequency component of the signals from theacceleration sensors 202a, 202b, and 202c is generated by the action ofthe friction between the pen's tip end 209 and the handwriting surface,and exceeds the frequency near 10 Hz. Therefore, the signal containingthis high-frequency component signifies the state of "handwriting".

The OR gate 434 takes the logical sum of the high-frequency component ofthe signals from the respective acceleration sensors 202a, 202b, and202c transmitted through the high-pass filters 431, 432, and 433, andoutputs the signal showing the state of "handwriting or not". Here,since the OR gate 434 takes the logical sum of the high-frequencycomponent of the signals from the acceleration sensors 202a, 202b, and202c, the "High" signal showing the state of "handwriting" is outputtedin case that any one or more of the signals from the accelerationsensors 202a, 202b, and 202c contain(s) the high-frequency component.

The initial rotational angle calculating section 244 calculates theinitial values θ₀, φ₀, and ψ₀ of the rotational angle in the gravitycoordinates system of the pen shaft 209 at the beginning of handwriting,on the basis of the acceleration in the pen shaft coordinates systemdetected by the three acceleration sensors 202a, 202b, and 202c in astate of non-handwriting.

The rotational angle variation calculating section 245 calculates therotational angle variations Δθ, Δφ, and Δψ in the gravity coordinatesystem of the pen shaft 209, on the basis of the rotational angularvelocity detected by the three gyroscopes 203a, 203b, and 203c in astate of handwriting.

The handwriting rotational angle calculating section 246 obtains therotational angles θ, φ, and ψ in the gravity coordinates system of thehandwriting pen shaft 209, on the basis of the initial values θ₀, φ₀,and ψ₀ of the rotational angle in the gravity coordinates system of thepen shaft 209 calculated by the initial rotational angle calculatingsection 204 and the variations Δθ, Δφ, and Δψ of the rotational angle inthe gravity coordinate system of the pen shaft 209 calculated by therotational angle variation calculating section 245.

The coordinates conversion calculating section 247 converts theacceleration in the pen shaft coordinates system detected by theacceleration sensors 202a, 202b, and 202c to the acceleration in thegravity coordinate system, on the basis of the rotational angles θ, φ,and ψ in the gravity coordinate system of the handwriting pen shaft 209detected by the handwriting rotational angle calculating section 246.

The movement amount calculating section 248 calculates the movementdirection and the movement distance of the pen's tip end 209, on thebasis of the acceleration in the gravity coordinate system converted bythe coordinates conversion calculating section 247, and stores the abovecalculated values in the storage section 205.

The operation of the pen-shaped input apparatus 201 having theabove-mentioned structure is described hereinafter referring to the flowchart shown in FIG. 23.

The acceleration sensors 202a, 202b, and 202c respectively detect theaccelerations in the Xs direction, the Ys direction, and the Zsdirection in accordance with the movement of the pen's tip end 209.

The handwriting detecting section 243 extracts the high-frequencycomponent of the signals from the acceleration sensors 202a, 202b, and202c inputted through the A/D converters 241a-241f, for instance,exceeding the frequency near 10 Hz, and outputs the signal showing thestate of "handwriting" or "non-handwriting."

Hereupon, in case that the high-frequency component above the frequencynear 10 Hz is contained in one or more of the signals from theacceleration sensors 202a, 202b, and 202c, the state is "handwriting".Namely, the high-frequency component of the signals from theacceleration sensors 202a, 202b, and 202c is generated by the action ofthe frictional force between the pen's tip end 209 and the handwritingsurface, and neighbors the frequency near 10 Hz. In such manner, theapparatus detects the high-frequency signal generated by the action ofthe frictional force between the pen's tip end 209 and the handwritingsurface, and judges the state of "handwriting" or "non-handwriting."

When the handwriting detecting section 243 detects the state ofnon-handwriting, the initial rotational angle calculating section 244performs the operation of inputting the signals from the accelerationsensor 202a for the Xs axis, the acceleration sensor 202b for the Ysaxis, and the acceleration sensor 202c for the Zs axis, and calculatesthe initial values θ₀, φ₀, and ψ₀ of the rotational angle in the gravitycoordinate system of the pen shaft 208 at the time of starting theoperation of handwriting (Step S201).

Next, a method of calculating the rotational angle is describedhereinafter. The conversion from the gravity coordinate system to thepen shaft coordinate system can be performed by use of the followingequation (equation 29). ##EQU25## as1=cosθcosψas2=cosθsinψ

as3=-sinθ

bs1=sinφsinθcosψ-cosφsinψ

bs2=sinφsinθsinψ+cosφcosψ

bs3=sinφcosθ

cs1=cosφsinθcosψ+sinφsinψ

cs2=cosφsinθsinψ-sinφcosψ

cs3=cosφcosθ

If the above equations are transformed to the converting equations fromthe pen shaft coordinate system to the gravity coordinate system, thefollowing equation (equation 30) can be obtained. ##EQU26##ag1=cosθcosψag2=sinφsinθcosψ-cosφsinψ

ag3=cosφsinθcosψ+sinφsinψ

bg1=cosθsinψ

bg2=sinφsinθsinψ+cosφcosψ

bg3=cosφsinθsinψ-sinφcosψ

cg1=-sinθ

cg2=sinφcosθ

cg3=cosφcosθ

The above equations are approximated by the first-order approximationformula, and thereby converting equations of the acceleration vectorscan be obtained. Moreover, assume that Axs, Ays, and Azs arerespectively the acceleration vectors detected by the accelerationsensors 202a, 202b, and 202c in the pen shaft coordinate system, andAxg, Ayg, and Azg are respectively the acceleration vectors detected bythe acceleration sensors 202a, 202b, and 202c in the gravity coordinatesystem, then the following equations (equations 31a, 31b) apply.##EQU27##

If the acceleration vectors Axs, Ays, and Azs and the rotational anglesθ, φ, and ψ are substituted for the above-mentioned first-orderapproximation formula, the acceleration vectors Axg, Ayg, and Azg on thehandwriting surface can be obtained.

On the other hand, the acceleration in a static state can be expressedby the following equation (equation 32). ##EQU28##

If the acceleration in this static state is substituted for theafore-mentioned coordinates conversion formula, the rotational anglesθ₀, and φ₀ in the gravity coordinate system of the pen shaft 208 in thestatic state at the time of starting the handwriting can be obtained asmentioned below. ##EQU29##

Here, since the rotational angle ψ₀ is the angle formed between the Zsaxis and the Zg axis, the Xg axis can be taken in the inclinationdirection of the Xs axis by resetting the rotational angle ψ₀ to zero.Or otherwise, it may be allowed also to optionally decide the rotationalangle ψ₀ in accordance with the method of putting the pen-shaped inputapparatus 201 on the handwriting surface and the method of gripping thepen-shaped input apparatus 201.

And further, since three equations can be established for the rotationalangles θ₀ and φ₀ in the static state, those angles can be treated alsoas the unknown figures for the gravity acceleration g, and the absolutevalues of the rotational angles θ₀ and φ₀ in the static state withoutdefining the value of the gravity acceleration g. Furthermore, the valueof g is calculated, and whether the calculation is good or bad is judgedin accordance with the variation of the value of this calculated gravityacceleration g. For instance, in case that the calculated value changeslargely, it may be allowed also to issue an alarm.

When the handwriting detecting section 243 detects the state ofhandwriting (Step S202), the rotational angle calculating section 245calculates the variations Δθ, Δφ, and Δψ of the rotational angles in thegravity coordinate system of the pen shaft 208, on the basis of therotational angular velocities calculated by the three gyroscopes 203a,203b, and 203c (Step S203). Assuming that the rotational angularvelocity of the respective axes Xs, Ys, and Zs of the pen shaftcoordinates are P, Q, and R, the relationship between the rotationalangular velocities P, Q, and R and the rotational angle variations Δφ,Δθ, and Δψ can be obtained by the following equations (equations 34a,34b, 34c).

    Δφ=P+Q sin φ tan θ+R cos φ tan θ(34a

    Δθ=Q cos φ-R sin φ                     (34b

    Δψ=Q sin φsecθ+R cos φsecθ   (34c

The handwriting rotation angle calculating section 246 obtains therotational angles θ, φ, and ψ of the handwriting pen shaft (Step S204),on the basis of the initial values θ₀, φ₀, and ψ₀ of the rotationalangle of the pen shaft 208 calculated by the initial angle calculatingsection 244 and the variations Δθ, Δφ, and Δψ of the rotational angle ofthe pen shaft 208 calculated by the rotational angle variationcalculating section 245. The coordinates conversion calculating section247 respectively converts the accelerations Axs, Ays, and Azs in the penshaft coordinate system detected by the acceleration sensors 202a, 202b,and 202c to the accelerations Axg, Ayg, and Azg in the gravitycoordinate system (Step S205), on the basis of the handwritingrotational angle detected by the handwriting rotational anglecalculating section 246. Moreover, in order to convert the accelerationsAxs, Ays, and Azs in the pen shaft coordinate system to theaccelerations Axg, Ayg, and Azg in the gravity coordinate system, theconversion formula already explained before is used.

The movement amount calculating section 248 calculates the movementdirection and the movement distance of the pen's tip end 209 (StepS206), on the basis of the acceleration of the pen's tip end 209converted by the coordinates conversion calculating section 247 (StepS206), and stores the calculated values in the storage section 205 (Step5207). The pen-shaped input apparatus 201 repeats the above-mentionedoperations (Steps S203-S207) until detecting the input ending signal,and inputs the figure, etc. (Step S208). In such manner, it may bepossible to precisely input the figure, etc., by compensating theinfluence due to the rotation angle in the gravity coordinate system ofthe pen-shaped input apparatus. One can also generate the input endingsignal on the basis of the acceleration variation. One may also employthe signal from the enable switch, etc.

Next, taking the case of handwriting in practice into consideration, forinstance, the acceleration Axs in the Xs-axis direction is as shown inFIG. 24. Here, the part encircled with a dotted line in FIG. 24 showsthe acceleration in an initial state of stopping. If the portionencircled with the dotted line is enlarged, the enlarged portion turnsout to be, for instance, as shown in FIG. 25. Namely, the accelerationvaries in practice even in the state that the pen's tip end 209 does notmove, as shown in FIG. 25.

This variation of the acceleration is derived from, for instance, thevibration of the hand gripping the pen-shaped input apparatus 201.Consequently, there occur some occasions on which the initial rotationalangle is calculated in a state of containing the influence due to thevibration of the hand, etc. For this reason, it may be allowed also thatthe apparatus is constructed as shown in FIG. 26 for example, and theinitial rotational angle calculating section 244a performs several timesthe calculation of the rotational angle of the pen shaft 208 in thegravity coordinate system (Xg, Yg, and Zg) on the basis of theaccelerations detected by the three acceleration sensors 202a, 202b, and202c in a state of non-handwriting and obtains the initial value of therotational angle of the pen shaft 208 at the time of the beginning ofhandwriting by averaging the result of the calculation.

The initial rotational angle calculating section 244a is provided with,for instance, a sample rotational angle calculating section 441, asampling frequency counting section 442, and an average valuecalculating section 443, as shown in FIG. 27.

The sample rotational angle calculating section 441. inputs the signalsfrom the acceleration sensor 202a for the Xs axis, the accelerationsensor 202b for the Ys axis, and the acceleration sensor 202c for the Zsaxis when the handwriting detecting section 443 does not input thesignal showing the state of handwriting, calculates the rotationalangles θ_(n), φ_(n), and ψ_(n) in the gravity coordinate system of thepen shaft 208 in a state of non-handwriting, and stores the calculatedvalues in the storage section 205.

The sampling frequency counting section 442 counts the frequency ofcalculating the rotational angles θ_(n), φ_(n), and ψ_(n) by use of thesample rotational angle calculating section 441.

The average value calculating section 443 reads out the rotationalangles θ_(n), φ_(n), and ψ_(n) calculated by the sample rotational anglecalculating section 441 and stored by the storage section 205, when thecounting value of the sampling frequency counting section 442 becomes,for instance, three or more, and calculates the average value thereof,and thereby calculates the initial value of the rotational angle of thepen shaft at the time of starting the handwriting.

The operation of the pen-shaped input apparatus 201a is describedhereinafter, referring to the flow chart as shown in FIG. 28.

The initial rotational angle calculating section 244a inputs the signalsfrom the acceleration sensor 202a for the Xs axis, the accelerationsensor 202b for the Ys axis, and the acceleration sensor 202c for the Zsaxis when the handwriting detecting section 243 detects the state ofnon-handwriting, calculates the rotational angles θ_(a), φ_(a), andψ_(a) in the gravity coordinate system of the pen shaft 208 at the timeof starting the handwriting in the state of non-handwriting, and storesthe calculated values in the storage section 205 (Step S211).

The initial rotational angle calculating section 244a repeats thesampling process, for instance, three or more times and thereby obtainsthe rotational angles θ_(a) -θ_(n), φ_(a) -φ_(n), and ψ_(a) -ψ_(n) (StepS212). Thereafter, the same calculates the average values of theobtained rotational angles θ_(a) -θ_(n), φ_(a) -φ_(n), and ψ_(a) -ψ_(n)and obtains the initial values θ₀, φ₀, and ψ₀ of the rotational angle ofthe pen shaft 208 (Step S213).

In such manner, since the initial values θ₀, φ₀, and ψ₀ of therotational angle of the pen shaft 208 by use of the average value, evenin case that one of the plural sampling values, for instance, isaffected by the vibration of the hand, etc., the exerted influencethereof can be averaged and made small.

When the rotational angle calculating section 245 has already detectedthe state of the handwriting by the handwriting detecting section 243(Step S214), the rotational angle calculating section 245 calculates thevariations Δθ, Δφ, and Δψ of the rotational angle in the gravitycoordinate system of the pen shaft 208, on the basis of the rotationalangular velocity detected by the three gyroscopes 203a, 203b, and 203c(Step S215).

The handwriting rotational angle calculating section 246 obtains therotational angles θ, φ, and ψ of the handwriting pen shaft (Step S216),on the basis of the initial values θ₀, φ₀, and ψ₀ of the rotationalangle of the pen shaft 208 calculated by the initial rotational anglecalculating section 244a and the variations Δθ, Δφ, and Δψ of therotational angle of the pen shaft 208 calculated by the rotational anglevariation calculating section 245.

The coordinates conversion calculating section 247 converts theaccelerations Axs, Ays, and Azs of the pen shaft coordinate systemdetected by the acceleration sensors 202a, 202b, and 202c to theaccelerations Axg, Ayg, and Azg in the gravity coordinate system (StepS217), on the basis of the handwriting rotational angle detected by thehandwriting rotational angle calculating section 246.

The movement amount calculating section 248 calculates the movementdirection and the movement distance of the pen's tip end 209 (StepS218), on the basis of the acceleration of the pen's tip end 209converted by the coordinates conversion calculating section 247, andstores the calculated values in the storage section 205 (Step S219). Thepen-shaped input apparatus 201 repeats the above-mentioned operations(Steps S215-S219) until the input ending signal is detected, and. inputsthe figure, etc. (Step S220). In such manner, the initial values θ₀, φ₀,and ψ₀ of the rotational angle of the pen shaft 208 is calculatedprecisely, and thereby the figure or the like can be inputted furtherprecisely.

Furthermore, it may be allowed also that, in case that the variationvalue of the acceleration detected by the acceleration sensors 202a,202b, and 202c exceeds the previously determined threshold value, theacceleration is removed from the accelerations to be sampled and/or thealarm is issued. The example of the construction to implement thisfeature is shown in FIG. 29.

The acceleration variation amount detecting section 249 respectivelydetects the variation amounts (ΔAxs)/(Δt), (ΔAys)/(Δt), and (ΔAzs)/(Δt)of the acceleration Axs in the Xs-axis acceleration, the accelerationAys in the Ys-axis acceleration, and the acceleration Azs in the Zs-axisacceleration. Here, "t" shows the time.

The variation amount comparing section 250 comprises, for example, athreshold storing section 501, an Xs-axis comparator, a Ys-axiscomparator, a Zs-axis comparator, and an OR gate, as shown in FIG. 30.The threshold storing section 501 stores the previously determinedthreshold value. The Xs-axis comparator, the Ys-axis comparator, and theZs-axis comparator compare the respective variation values of theaccelerations Axs, Ays, and Azs detected by the acceleration variationamount detecting section 249 with the respective threshold values storedin the threshold storing section 501. The OR gate 505 may be allowed toissue the alarm signal through the alarming section 251, in case thateither one or more of the variation amounts of the accelerations Axs,Ays, and Azs exceed(s) the previously determined threshold value(s). Forinstance, as shown by the dotted line in FIG. 31, the threshold valuesare set at +1.5 (m/sec³) and at -1.5 (m/sec³), and the alarm signal isissued through the alarming section 251 in case that the variationamount (ΔA)/(Δt) of the acceleration A becomes +1.5 (m/sec³) or more orin case that the same becomes -1.5 (m/sec³) or less. Thereby, the usercan know the occurrence of the input error. The above threshold valuemay be stored in the storage section 205 or it may be stored in the hostapparatus. Furthermore, the alarm output from the alarming section 251is transmitted to the host apparatus through the communicating section207 and causes the host apparatus to display the error. Or, a lamp isprovided on the pen-shaped input apparatus 201c and the error display isperformed by lighting the lamp. Alternatively, the error occurrence isnotified by use of a buzzer.

Furthermore, when the variation amounts of the accelerations Axs, Ays,and Azs are large, the variation amount comparing section 250 removesthe acceleration(s) of large variation amount from the data to becalculated (for the movement amount) and continues the input processing.For instance, in case that the variation amount (ΔA)/(Δt) becomes +1.5(m/sec) or more or in case that the same becomes -1.5 (m/sec³) or less,the variation amount comparing section 250 notifies the above matter tothe initial rotational angle calculating section 244b.

During the time period when the initial rotational angle calculatingsection 244b receives the notification of too large accelerationvariation from the variation amount comparing section 250, the section244b reads off (does not read) the acceleration detected by theacceleration sensors 202a, 202b, and 202c and removes the accelerationat the time of the abnormal input occurrence from the data to becalculated (for the initial rotational angle). Consequently, themovement direction and the movement distance of the pen's tip end 209can be calculated further precisely.

Moreover, although the handwriting detecting section 243 detects thestate of handwriting or not on the basis of the accelerations Axs, Ays,and Azs detected by the acceleration sensors 202a, 202b, and 202c in theabove-mentioned embodiment, a pressure sensor 211 may be used fordetecting the pressure applied to the pen's tip end 209 from thehandwriting surface 210 as shown in FIG. 32, or a signal for showing thestate of handwriting or not from the enable switch, etc. is input.

And further, although the acceleration detected by the accelerationsensors 202a, 202b, and 202c is read off during the time period when theinitial rotational angle calculating section receives the notificationof too large an acceleration variation from the variation amountcomparing section 250 in the above embodiment, the accelerations fromthe low-pass filters 242a-242c may be input to the initial rotationalangle calculating section 244a through the acceleration abnormal valueremoving section, and the acceleration abnormal value removing sectiontransmits the acceleration in the range determined by the (two)threshold values and outputs the transmitted acceleration to the initialrotational angle calculating section 244a.

Moreover, the sampling data of the static state rotational anglecalculated by the initial rotational angle calculated by the initialrotational angle calculating section 244b and stored in the storagesection 205 may be erased.

Furthermore, an element such as LED, etc. may be employed for displayingthe time period when the initial rotational angle calculating 244 iscalculating the initial rotational angle.

Finally, as an additional explanation, the output of the accelerationsensor at the time of performing the handwriting in practice isdescribed hereinafter in more detail.

FIG. 33a shows the acceleration waveform in the X direction in the caseof handwriting the mark "Åo" by use of the pen-shaped input apparatus.The area encircled with the dotted line represents the acceleration dataat the initial static time. Noticing this area, an enlarged waveform isshown in FIG. 33b.

Practically, as shown in FIG. 33b, a variation can be found in the areaassumed as the static state. It seems that the above variation iscaused, for instance, by the vibration of the hand gripping thepen-shaped input apparatus, or the like. There is a probability that,when the acceleration at an optional one point is taken, the inclinationamount in the gravity coordinate system of the pen shaft is obtained onthe assumption of the static state, the obtained value becomes theamount including the acceleration caused by the vibration of the hand,etc. Therefore, it causes an error, or undesirably creates a factor forworsening the reproducing property.

In order to solve such defect, the average value of more than at least acertain value (for instance, three) as shown by the dotted line in FIG.33b is used. Since the frequency of the handwriting acceleration (theacceleration caused by the pen's movement at the time of handwriting) isseveral Hz as shown in FIG. 33a and FIG. 33b, for instance, thefrequency of the acceleration variation caused by the vibration of thehand, etc. is almost 10 Hz, it is difficult to separate such unfavorablecomponent by means of filtering or the like. For this reason, thisproblem can be solved easily and very efficiently by use of theaveraging process. In such method and structure as mentioned above, itis possible to obtain the inclination value in the gravity coordinatesystem of the pen shaft without being affected by the vibration of thehand or the like.

As is apparent from the foregoing description, since this thirdembodiment calculates the initial value of the rotational angle of thepen shaft at the beginning of handwriting in the gravity coordinatesystem, on the basis of the acceleration in the pen shaft coordinatesystem when the signal showing the non-handwriting state is input, theinitial value of the rotational angle of the pen shaft can be obtainedprecisely and the operation thereof can be done simply.

Furthermore, since the variation of the rotational angle in the penshaft gravity coordinate system is calculated on the basis of therotational angular velocity of the pen shaft at the time of inputtingthe signal showing the state of handwriting, the rotational angle in thegravity coordinate system of the handwriting pen shaft on the basis ofthe initial value of the rotational angle and the variation of therotational angle, the acceleration in the pen shaft coordinate system ofthe pen's tip end is converted to the acceleration in the gravitycoordinate system on the basis of the calculated rotational angle in thegravity coordinate system of the handwriting pen shaft, and the movementdirection and the movement distance of the pen's tip end on the basis ofthe converted acceleration, characters, symbols, figures, etc. can beinput precisely with a small-sized apparatus.

And further, since whether the pen's tip end is brought into contactwith the handwriting surface is judged on the basis of thehigh-frequency component of the signals from the three accelerationsensors, the beginning of handwriting can be judged precisely.

And further, since the stress applied to the pen's tip end from thehandwriting surface is detected and thereby whether the pen's tip end isbrought into contact with the handwriting surface is judged, the startof handwriting can be judged even more precisely.

Furthermore, since the calculating treatment of the rotational angle ofthe pen shaft in the gravity coordinate system is performed severaltimes, and the initial value of the rotational angle of the pen shaft isobtained by averaging the result of the above calculation, the initialvalue of the rotational angle of the pen shaft can be calculated evenmore precisely.

Furthermore, since the variation value of the acceleration in the penshaft coordinate system of the pen's tip end is detected, the detectedvariation value of the acceleration is compared with the previouslydetermined threshold value, and an alarm signal is issued when thedetected variation value of the acceleration exceeds the predeterminedthreshold value and the variation amount comparing section judges theabove state, the possibility of the above error detection occurrence canbe notified to the user.

Furthermore, since the acceleration of the large variation value isremoved and the initial value of the rotational value of the pen shaftis calculated on the above condition, the movement direction and themovement distance of the pen's tip end can be calculated precisely evenwhere an abnormal input may occur.

The various functional blocks (sections) described above may beimplemented in computer hardware or software. When implemented insoftware a computer processor such as a microprocessor is programmed tocarry out the structural functions and operational steps describedherein. The software may be stored on a suitable recording medium, e.g.CD ROM, floppy disk, hard drive, etc. and may also be transmitted over anetwork for downloading and storage and later operation in a computerprocessor.

What is claimed is:
 1. An information recording medium containing aprogram which operates a computing processor to determine data relatingto the movement of a pen-shaped device having a tip end on a surface,said computing processor, under control of said program, performing thesteps of:detecting acceleration data provided in a pen shaft Xs, Ys, Zscoordinate system where a pen shaft axis is the Zs axis and convertingthe acceleration data to a gravity coordinate system having a Z axis ina gravity acceleration direction, detecting whether said pen-shapeddevice is in a state of handwriting or non-handwriting, calculating aninitial inclination angle of said pen shaft in said gravity coordinatesystem when said pen shaft is in a state of non-handwriting, calculatingan inclination angle variation amount in accordance with the angularvelocities around the respective axes of said pen shaft coordinatesX_(s), Y_(s) and Z_(s) based on data generated from gyroscopes connectedto a said pen shaft which occurs when said pen shaft is in a state ofnon-handwriting, calculating a handwriting gravity coordinate systeminclination angle, on the basis of said gravity coordinate initialinclination angle and said gravity coordinate system inclined anglevariation amount, converting said pen shaft coordinate systemacceleration to acceleration in the gravity coordinate system, on thebasis of said handwriting gravity coordinate inclination angle, andcalculating the movement direction and the movement distance of thepen's tip end in accordance with the acceleration in said gravitycoordinate system, and storing said calculated movement direction andmovement distance in a storage apparatus.
 2. An information recordingmedium as defined in claim 1, wherein said program also causes computersystem to:convert said gravity coordinate system acceleration to theacceleration in the gravity coordinate system at the pen's tip end, themovement direction and the movement distance of the pen's tip end beingcalculated in accordance with the converted acceleration of the pen'stip end in said gravity coordinate system, and said calculated movementdirection and movement distance of the pen's tip end being stored insaid storage apparatus.
 3. An information recording medium containing aprogram which operates a computing processor to determine data relatingto the movement of a pen-shaped device having a pen shaft and tip end ona surface, said computing processor under control of said programperforming the steps of:converting acceleration information received asdata in pen shaft coordinate system where a pen shaft axis is the Zsaxis to acceleration data in a gravity coordinate system having a Z axisin the gravity acceleration direction, detecting when the tip end isbrought into contact with the surface, and calculating, in accordancewith the gravity acceleration direction, an initial inclination anglefor the pen shaft when the tip end is brought into contact with thesurface and is in a state of non-handwriting.
 4. An informationrecording medium containing a program which operates a computingprocessor to determine data relating to the movement of a pen shapeddevice having a pen shaft and tip end on a surface, said computingprocessor under control of said program performing the stepsof:converting acceleration information received as data in a pen shaftcoordinate system where a pen shaft axis is the Zs axis to a gravitycoordinate system acceleration having a Z axis in the gravityacceleration direction, detecting whether the tip end is brought intocontact with the surface, and calculating, in accordance with thegravity acceleration direction, an initial inclination angle for thegravity coordinate system.